random variables - uc3mhalweb.uc3m.es/esp/personal/personas/icascos/esp/2rvariables.pdf · 2....
TRANSCRIPT
![Page 1: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/1.jpg)
Random variables
Ignacio Cascos Depto. Estadística, Universidad Carlos III 1
2
![Page 2: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/2.jpg)
Outline1. Definition of randomvariable2. Discrete and continuous randomvariables
� Discrete randomvariables (probabilitymassfunctionand cdf)
Ignacio Cascos Depto. Estadística, Universidad Carlos III 2
(probabilitymassfunctionand cdf)� Continuos randomvariables
(density mass function and cdf)
3. Characteristic features of a randomvariable� Location, scatter and shape parameters� Independent randomvariables
![Page 3: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/3.jpg)
Definition of random variable
A random variableassesses a real number to
each possible outcome of the random experiment.
Ignacio Cascos Depto. Estadística, Universidad Carlos III 3
each possible outcome of the random experiment.
It is randombecause we do not know its value
before carrying out the random experiment.
![Page 4: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/4.jpg)
Definition of random variable� Definition. A random variableX is a mapping
X: E → IR, where E is the sample space associated with a random experiment.
Ignacio Cascos Depto. Estadística, Universidad Carlos III 4
e1
e3
e2
X (e3) X (e2) X (e1)
X
IR
![Page 5: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/5.jpg)
Definition of random variable� The eventsare now of the type X∈A,
where A is a subset of IR.Their probabilities are P(X∈A) = P({ e∈E: X(e)∈A}).
Ignacio Cascos Depto. Estadística, Universidad Carlos III 5
Properties:
1. P(X∈A) ≥ 0 ;
2. P(X∈IR) = 1 ;
3. if A1, A2,…⊂IR satisfy Ai∩Aj= ∅ for i ≠ j,
thenP(X∈∪i= 1,∞ Ai)=Σi= 1,∞ P(X∈Ai) .
![Page 6: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/6.jpg)
Outline1. Definition of randomvariable2. Discrete and continuous randomvariables
� Discrete randomvariables (probabilitymassfunctionand cdf)
Ignacio Cascos Depto. Estadística, Universidad Carlos III 6
(probabilitymassfunctionand cdf)� Continuos randomvariables
(density mass function and cdf)
3. Characteristic features of a randomvariable� Location, scatter and shape parameters� Independent randomvariables
![Page 7: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/7.jpg)
Discrete and continuous random variablesThe rangeof a random variable is the set of values that
it can assume.
� A random variable is discreteif its range is finite or denumerable.
Ignacio Cascos Depto. Estadística, Universidad Carlos III 7
denumerable.� Examples: number of defective items, number of rolls of a
die until a 5 occurs.
� A random variable is continuousif its range contains an interval.� Example: battery life.
![Page 8: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/8.jpg)
Discrete random variablesGiven a discrete random variable X, its probability mass function assigns to each possible value of the variablethe probability that X assumes such a value.
p: IR → [0,1]
Ignacio Cascos Depto. Estadística, Universidad Carlos III 8
p: IR → [0,1]
x → p(x) = P(X=x)
It satisfies that 0 ≤ p(x) ≤ 1 for every x and if X assumes
n different possible values x1,…,xn , thenΣi p(xi) = 1.
We have P(X∈A) = Σxi∈A p(xi) .
![Page 9: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/9.jpg)
Discrete random variablesLet X be the number of heads
after tossing 3 times a fair
coins. The probability mass
function of X is:
Funcion de probabilidad
0.25
0.30
0.35
Probability mass function
Ignacio Cascos Depto. Estadística, Universidad Carlos III 9
function of X is:
0 1 2 3
numero motores averiados
prob
abili
dad
0.00
0.05
0.10
0.15
0.20
0.25
x p(x) = P(X=x)
0 0.125
1 0.375
2 0.375
3 0.125
![Page 10: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/10.jpg)
Discrete random variablesThe cumulative distribution function (cdf)of Xat x is the probability that X is smaller or equal to x.
≤
Ignacio Cascos Depto. Estadística, Universidad Carlos III 10
F(x) = P(X ≤ x)1. limx→ −∞ F(x) = 0 ;2. limx→ ∞ F(x) = 1 ;3. F is nondecreasing ;4. F is right-continuous.
![Page 11: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/11.jpg)
Discrete random variablesThe cumulative
distribution function of
a discrete random
0.8
1.0
Funcion de distribucioncdf
Ignacio Cascos Depto. Estadística, Universidad Carlos III 11
a discrete random
variable is stepwise,
F(x) = P(X ≤ x)
= Σxi ≤ x p(xi) -1 0 1 2 3 4
0.0
0.2
0.4
0.6
numero motores averiados
prob
abili
dad
pro
bab
ility
![Page 12: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/12.jpg)
Continuous random variablesSince the range of a continuous random variable is not
denumerable, an expression like Σi p(xi) = 1 makes no sense.
Histogram for the lifetime of 10000 batteries.
Ignacio Cascos Depto. Estadística, Universidad Carlos III 12
Histogram of duracion
duracion
Den
sity
0 2 4 6 8
0.0
0.2
0.4
0.6
0.8
Histogram of duracion
duracion
Den
sity
0 2 4 6 8
0.0
0.2
0.4
0.6
0.8
Histogram for the lifetime of 10000 batteries.
![Page 13: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/13.jpg)
Continuous random variablesFunction f describes the
curve drawn together
with the histogram on
0.8
1.0
Ignacio Cascos Depto. Estadística, Universidad Carlos III 13
with the histogram on
the right. We have
P(2 ≤ X ≤ 4) ≈ ∫24 f(x)dx
where X is the lifetime of
a battery. 0 2 4 6 8
0.0
0.2
0.4
0.6
dens
idad
den
sity
![Page 14: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/14.jpg)
Continuous random variablesThe density mass functionf describes the probability
distribution of a continuous random variable. It satisfies:
1. f(x) ≥ 0 ;
Ignacio Cascos Depto. Estadística, Universidad Carlos III 14
1. f(x) ≥ 0 ;
2. ∫−∞+∞ f(x)dx = 1 .
3. We haveP(a ≤ X ≤ b) = ∫ab f(x)dx .Given X continuous r.v., it satisfies
� P(X = a) = 0 ;
� P(a ≤ X ≤ b) = P(a < X ≤ b) = P(a ≤ X < b) = P(a < X < b)
![Page 15: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/15.jpg)
Continuous random variablesIn order to compute the cumulative distribution Function (cdf) of a continuous random variable, we must integrate its density mass function,
≤ ∫
Ignacio Cascos Depto. Estadística, Universidad Carlos III 15
F(x) = P(X ≤ x) = ∫−∞x f(t)dt
1. limx→ −∞ F(x) = 0 ;2. limx→ ∞ F(x) = 1 ;3. F is nondecreasing ;4. F is continuous .
![Page 16: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/16.jpg)
Continuous random variablesSince the cumulative distribution
function is a primitive of the
density mass function, deriving
the cdf, we obtain the density
Mean1
Exponential Distribution
cum
ula
tive
pro
bab
ility
0,8
1
Ignacio Cascos Depto. Estadística, Universidad Carlos III 16
the cdf, we obtain the density
mass function,
f(x) = dF(x)/dx .
We are working with
f(x) = e−x if x > 0
F(x) = 1− e−x if x > 0x
cum
ula
tive
pro
bab
ility
-1 0 1 2 3 4 5 6 7 80
0,2
0,4
0,6
![Page 17: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/17.jpg)
Outline1. Definition of randomvariable2. Discrete and continuous randomvariables
� Discrete randomvariables (probabilitymassfunctionand cdf)
Ignacio Cascos Depto. Estadística, Universidad Carlos III 17
(probabilitymassfunctionand cdf)� Continuos randomvariables
(density mass function and cdf)
3. Characteristic features of a randomvariable� Location, scatter and shape parameters� Independent randomvariables
![Page 18: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/18.jpg)
Mathematical expectation or meanThe expecationor mean(µ) of a random variable
is a central point with respect to its distribution
� X discrete, µ = E[X] = ∑xip(xi)
Ignacio Cascos Depto. Estadística, Universidad Carlos III 18
� X discrete, µ = E[X] = ∑xip(xi)
� X continuous, µ = E[X] = ∫ xf(x)dx
Properties: Given X,Yand two real numbers, a,b
1. E[a+bX] = a+bE[X] ;
2. E[X+Y] = E[X]+E[Y] .
![Page 19: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/19.jpg)
Mathematical expecation or meanGiven a functiong: IR → IR, the expectation of
randomvariable g(X) can be computed as
Ignacio Cascos Depto. Estadística, Universidad Carlos III 19
� X discrete, E[g(X)] = ∑g(xi)p(xi)
� X continuous, E[g(X)] = ∫ g(x)f(x)dx
![Page 20: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/20.jpg)
MedianThe medianof a random variable X is a value Me
such that
≥ ≥ ≥
Ignacio Cascos Depto. Estadística, Universidad Carlos III 20
F(Me) ≥ 1/2 ; P(X ≥ Me) ≥ 1/2
If X is a continuous r.v., then F(Me) = 1/2.
![Page 21: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/21.jpg)
QuantilesFor 0 < α < 1, the α-quantileof random variable X is a
value xα such that the probability of X being not greater
than xα is, at least, α and the probability of X being not
−α
Ignacio Cascos Depto. Estadística, Universidad Carlos III 21
smaller than xα is, at least, 1−α.
F(xα) = P(X ≤ xα) ≥ α ; P(X ≥ xα) ≥ 1−α Percentilesand quartilesare defined in a similar way
Pa = xa/100 ; Qi = P25i
where1 ≤ a ≤ 99 and 1 ≤ i ≤ 3 .
![Page 22: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/22.jpg)
Scatter parametersThe varianceof a random variable X is given by
σ2 = Var[X] = E[(X−E[X])2]
� X discrete, σ2 = Var[X] = ∑(xi−µ)2 p(xi)
Ignacio Cascos Depto. Estadística, Universidad Carlos III 22
� X discrete, σ2 = Var[X] = ∑(xi−µ)2 p(xi)
� X continuous, σ2 = Var[X] = ∫ (x−µ)2 f(x)dx
The standard deviationis the (positive) square
root of the variance, σ = (Var[X])1/2 .
![Page 23: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/23.jpg)
Scatter parametersProperty. Var[X] = E[X2]−E[X]2 = E[X2]−µ2
Given a,b∈IR and a random variable X, we have
Ignacio Cascos Depto. Estadística, Universidad Carlos III 23
the following properties of the variance
1. Var[b] = 0 ;
2. Var[aX] = a2Var[X] ;
3. Var[aX+b] = a2Var[X] .
![Page 24: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/24.jpg)
Shape parametersDescribe features from the distribution of a r.v.
different from location and scatter
k-th moment about the origin, m = E[Xk]
Ignacio Cascos Depto. Estadística, Universidad Carlos III 24
k-th moment about the origin, mk = E[Xk]
k-th moment about the mean, µk = E[(X−µ)k]
� Skewness. Skew = µ3/σ3
� Kurtosis. Kurt = µ4/σ4−3
![Page 25: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/25.jpg)
Independent random variablesTwo random variables X and Yare independent
if for any A,B⊂IR,
P((X∈A)∩(Y∈B)) = P(X∈A)P(Y∈B)
Ignacio Cascos Depto. Estadística, Universidad Carlos III 25
P((X∈A)∩(Y∈B)) = P(X∈A)P(Y∈B)
Equivalently, for any x,y∈IR
P((X ≤ x)∩(Y ≤ y)) = P(X ≤ x)P(Y ≤ y)
Property. If X and Yare independent,
Var[X+Y] = Var[X]+Var[Y]
![Page 26: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/26.jpg)
Example(solidmissilefuel)An important factor in solid missile fuel is the particle size.
Significant problems occur if the particle sizes are too large.
From production data in the past, it has been determined that
the particlesize (X micrometers) distribution is the particlesize (X micrometers) distribution is
characterized by
Ignacio Cascos Depto. Estadística, Universidad Carlos III 26
>
=otherwise0
1 if)(
2 xxkxfX
![Page 27: Random variables - UC3Mhalweb.uc3m.es/esp/Personal/personas/icascos/esp/2rvariables.pdf · 2. Discrete and continuous random variables Discrete random variables (probability mass](https://reader030.vdocument.in/reader030/viewer/2022040101/5eacf2fcb7e38c00ad1c1465/html5/thumbnails/27.jpg)
Example(solidmissilefuel)� Compute the value of k so that fX(x) is a valid density
function.
� Find the cumulative distribution function FX(x).
� What size x is exceeded by 50% of the particles?� What size x is exceeded by 50% of the particles?
� What is the probability that the size of a random particle from the manufactured fuel exceeds 4 micrometers?
� What is the probability that the size of a random particle from the manufactured fuel is lower than 5 if we know that it exceeds 4 micrometers?
Ignacio Cascos Depto. Estadística, Universidad Carlos III 27