Documente Academic
Documente Profesional
Documente Cultură
http://www.imageprocessingbook.com/DIP2E/dip2e_downloads/review_material_downloads.htm
Random Variables
and
Random Vectors
Random variables
X = 0 if heads
X = 1 if tails
What is the pmf of this
random variable?
Continuous
Infinitely many possible values for the random variable
E.g., X {Real numbers}
P (a )
0.5
0
0
p(1.3) = ?
0
0
1
p(2.4) = ?
0.5
0.5
X {1, 2, 3, 4, 5, 6}
What is the
pmf of this
random variable?
Random variables
p( x)dx = 1?
p(h)
p(h)
= E(X)
Variance
E ((X ) 2 )
Var(X)
Discrete r.v.
Continuous r.v.
= ai P (ai )
x p(x) dx
(a )
P(ai )
(x )
p(x) dx
1
2
( x )2
2
X ~ N(, 2)
m=
1 n
xi
n i=1
Estimated variance:
2 =
1 n
(x i m)2
n i=1
2 =
1
(x i m)2 unbiased estimate
n 1 i=1
maximum
likelihood estimate
Samples x = [x1 x 2 x 3 L x n ]
Mean
>> m = (1/n)*sum(x)
Variance
1
= [x1 m
n
2
Method 1:
Method 2:
x1 m
x m
x 2 m L x n m] 2
M
x n m
>> v = (1/n)*(x-m)*(x-m)
>> z = x-m
>> v = (1/n)*z*z
Gaussian
= 67 , 2 = 20
What if you went
to a planet where
heights Gaussian
= 75 , 2 = 5
How would they be
different from us?
Random vectors
An n-dimensional random vector consists of n
random variables that are all associated with the same
events.
Example 2-D random vector:
X
V =
Y
y1 y 2 L y n
Tim Marks, Cognitive Science Department
Random Vectors
What will the graph of V look like?
67
m =
10
x (heights)
Mean
Mean of X is 67
Mean of Y is 10
y
(wake-up
times)
n samples from V
What is mean of V ?
m=
v1 v 2 L v n
x1 x 2 L x n
y1 y 2 L y n
n
n
1
1 x m x
v i = i =
n i=1
n i=1 y i m y
Random vector
Example 2-D random vector:
X
V =
Y
y1 y 2 L y n
x1
y1
x2 L xn
y2 L yn
Means
mx m_x
my m_y
x = [x1 x 2 x 3 L x n ]
y = [y1 y 2 y 3 L y n ]
1 n
(x i mx )(y i my )
n i=1
maximum
likelihood estimate
1 n
(x i mx )(y i my )
n 1 i=1
unbiased estimate
Covariance
1
Cov(X,Y ) = [x1 m x
n
x 2 mx
y1 m y
y 2 my
L x n mx ]
M
y n my
Cov(X, X) = ?Var(X)
Cov(X, Y) = Cov(Y, X)
Tim Marks, Cognitive Science Department
Covariance matrix of a
D-dimensional random vector
X X
= E
[X X
Y Y
In 2 dimensions
X
V =
Y
T
Cov(V) = E (V )(V )
X ~ N(67, 20)
)
Var(X ) Cov(X,Y )
Y Y ] =
Var(Y)
Cov(X,Y )
In D dimensions
T
Cov(V) = E ((V )(V ) )
When is a covariance matrix symmetric?
A. always, B. sometimes, or C. never
Tim Marks, Cognitive Science Department
X
V =
Y
20 0
0 1
x
V = 1
y1
x2 L xn
y2 L yn
1
Cov(V ) =
n
x1 m x
y1 m y
mx
m=
my
x1 mx
x 2 mx L x n mx x 2 mx
y 2 my L y n my M
x n mx
>> m = (1/n)*sum(v,2)
>> z = v - repmat(m,1,n)
>> v = (1/n)*z*z
Tim Marks, Cognitive Science Department
X ~ N(, 2)
y1 m y
y 2 my
M
y n my
p(x) =
1
2
(x )2
2
p(x) =
1
(2 )
D/2
1/ 2
12 (x )T 1 (x )