StatIdea Slides 5

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

5.

Functions of Random Variables

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 1 / 36


5.1. The distribution of a function of a random object

Let x̃ : (W, F , P ) "! (W0 , F 0 ) be a random object with distribution


Px̃ and g : (W0 , F 0 ) "! (W00 , F 00 ) be a measurable function. Then,
the distribution of the random object
ỹ = g (x̃ ) : (W, F ) "! (W00 , F 00 ) is given by

Pỹ (B ) = Pg (x̃ ) (B ) = P fg (x̃ ) 2 B g


! " # $
= P x̃ 2 g "1 (B ) = Px̃ g "1 (B ) , for all B 2 F 00 .

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 2 / 36


5.2. The distribution function of a vector-valued function
of a random object
Let x̃ : (W, F , P ) "! (W0 , F 0 ) be a random object with distribution
Px̃ and g : (W0 , F 0 ) "! (Rn , B) be a vector-valued Borel measurable
function. Then, the distribution function Fỹ : Rn "! R of the
random vector ỹ = g (x̃ ) : (W, F ) "! (Rn , B) is given by
Fỹ (y ) = P fỹ 5 y g = P fg (x̃ ) 5 y g = P fg (x̃ ) 2 ("•, y ]g
! " # $
= P x̃ 2 g "1 ("•, y ] = Px̃ g "1 ("•, y ]
! "
= Px̃ x 2 W0 jg (x ) 5 y .

Recall that y = (y1 , y2 , ..., yn ) 2 Rn and

("•, y ] = fz 2 Rn jz 5 y g
= fz 2 Rn jz1 * y1 , z2 * y2 , ..., zn * yn g .

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 3 / 36


If Fỹ (y ) is absolutely continuous, then the density function will be

∂n Fỹ (y1 , y2 , ..., yn )


fỹ (y1 , y2 , ..., yn ) = .
∂y1 ∂y2 ...∂yn

when this nth crossed partial derivative of Fỹ exists. Moreover, this
derivative exists a.e. w.r.t. Lebesgue measure on (Rn , B).

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 4 / 36


Example: Let z̃ be a random variable and x̃ = jz̃ j + 0. Then

Fx̃ (x ) = P fx̃ * x g = P fjz̃ j * x g = P f"x * z̃ * x g

= Pz̃ ["x, x ] = Fz̃ (x ) " lim " Fz̃ (s ) , for x + 0.


s !"x

and Fx̃ (x ) = 0 for x < 0.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 5 / 36


Assume now that z̃ , N(0, 1). Then, Fz̃ is absolutely continuous
(and, hence, continuous), so that the distribution function of x̃ = jz̃ j
is 8
< Fz̃ (x ) " Fz̃ ("x ) for x + 0
Fx̃ (x ) =
:
0 for x < 0,

and its density is


8
< fz̃ (x ) + fz̃ ("x ) = n(x; 0, 1) + n("x; 0, 1) for x > 0
fx̃ (x ) =
:
0 for x * 0.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 6 / 36


Given the symmetry of the density function n(-; 0, 1) with respect to
0, we get
8 r
>
> 2 " 1 x2
< 2n(x; 0, 1) = e 2 for x > 0
fx̃ (x ) = p
>
>
:
0 for x * 0.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 7 / 36


5.3. The probability function of a function of a discrete
random variable

Let x̃ : (W, F , P ) "! (W0 , F 0 ) be a random object with distribution


Px̃ , g : (W0 , F 0 ) "! (Rn , B) be a vector-valued Borel measurable
function, and the random vector ỹ = g (x̃ ) : (W, F ) "! (Rn , B) be
discrete (i.e., ỹ (W) is discrete or countable). Then, the probability
function fỹ : ỹ (W) "! [0, 1] of the random vector ỹ is given by
# $
fỹ (y ) = Pỹ fy g = Px̃ g "1 (y ) , for all y 2 g (x̃ (W)) . ỹ (W).

If either x̃ is discrete (i.e., x̃ (W) is discrete or countable) or g is


discrete (i.e., g (W0 ) is discrete or countable), then the random vector
ỹ = g (x̃ ) is discrete (i.e., ỹ (W) . g (x̃ (W)) is discrete or countable)

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 8 / 36


If x̃ : (W, F , P ) "! (Rm , B) is a discrete random vector with
probability function fx̃ : x̃ (W) "! [0, 1] and
g : (Rm , B) "! (Rn , B) , then the probability function
fỹ : ỹ (W) "! [0, 1] of the discrete random vector
ỹ = g (x̃ ) : (W, F ) "! (Rn , B) is given by
# $
fỹ (y ) = Pỹ fy g = Px̃ g "1 (y )

= Â fx̃ (x ) , for all y 2 g (x̃ (W)) . ỹ (W).


x 2g "1 (y )

If the restriction of the function g to the range of x̃,


g : x̃ (W) "! g (x̃ (W)), is a one-to-one correspondence, then
# $
fỹ (y ) = Pỹ fy g = Px̃ g "1 (y )
# $
= fx̃ g "1 (y ) , for all y 2 g (x̃ (W)) . ỹ (W).

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 9 / 36


Example: Let x̃ be a binomial random variable with probability
function
* +
n x
bx̃ (x; n, q ) = q (1 " q )n "x , x = 0, 1, ..., n
x

and let ỹ = g (x̃ ) = be the percentage of successes in n
n
independent trials. Note that x = g "1 (y ) = ny . Then,
g (x̃ (W)) = f0, 1/n, 2/n, ..., 1g and

fỹ (y ; n, q ) = bx̃ (g "1 (y ) ; n, q )


n (1 "y )
* + z }| {
n 1 2 n"1
= q ny (1 " q )n " ny , y = 0, , , ..., , 1.
ny n n n

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 10 / 36


5.4. Convolutions.

DeÖnition. The convolution of two independent random variables on


the same probability space, x̃ : (W, F , P ) "! (R, B) and
ỹ : (W, F , P ) "! (R, B) , is the distribution of their sum, x̃ + ỹ , i.e.,
the distribution of the random variable z̃ = x̃ + ỹ , with
z̃ : (W, F , P ) "! (R, B) .

Convolution distribution: Consider two random variables x̃ and ỹ


on the same probability space (W, F , P ), then the distribution of the
random variable z̃ = x̃ + ỹ is

Pz̃ (B ) = Px̃ +ỹ (B ) = P fx̃ + ỹ 2 B g

= P fw 2 W j x̃ (w ) + ỹ (w ) 2 B g , for all B 2 B .

Independency is not required for the previous expression.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 11 / 36


Convolution distribution function: If the two random variables x̃
and ỹ on the same probability space (W, F , P ) are independent, then
the distribution function of the random variable z̃ = x̃ + ỹ is

Fz̃ (z ) = Fx̃ +ỹ (z ) = P fx̃ + ỹ * z g


Z Z
= P fx̃ + ỹ * z jx̃ = x g dFx̃ (x ) = P fx + ỹ * z g dFx̃ (x )
R R
Z Z
= P fỹ * z " x g dFx̃ (x ) = Fỹ (z " x )dFx̃ (x ),
R R
where the third equality comes from the theorem of total probability
and the fourth from the independence between x̃ and ỹ . Note that, if
these two variables where not independent, then we will have that
P fx̃ + ỹ * z jx̃ = x g = P fx + ỹ * z jx̃ = x g , which is not
necessarily equal to P fx + ỹ * z g .

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 12 / 36


Proposition. Assume that the two random variables x̃ and ỹ on the
same probability space (W, F , P ) are independent.
(a) If x̃ and ỹ are discrete with the probability functions
fx̃ : x̃ (W) "! [0, 1] and fỹ : ỹ (W) "! [0, 1] , respectively, then the
probability function of their sum z̃ = x̃ + ỹ (i.e., the convolution
pmf) is

fx̃ +ỹ (z ) = fz̃ (z ) = Â fỹ (z " x )fx̃ (x ), for z 2 z̃ (W),


x 2x̃ (W)

with z " x 2 ỹ (W).


(b) If x̃ and ỹ are absolutely continuous with the densities
fx̃ : R "! R and fỹ : R "! R, respectively, then the density of their
sum z̃ = x̃ + ỹ (i.e., the convolution pdf) is
Z
fx̃ +ỹ (z ) = fz̃ (z ) = fỹ (z " x )fx̃ (x )dx.
R

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 13 / 36


Proof. (a) DeÖne the discrete random variable z̃ = x̃ + ỹ . Then, the
probability function of z̃, fz̃ : z̃ (W) "! [0, 1] , satisÖes

fz̃ (z ) = fx̃ +ỹ (z ) = P fx̃ + ỹ = z g

= Â P fx̃ + ỹ = z jx̃ = x g - P fx̃ = x g


x 2x̃ (W)

= Â P fx + ỹ = z g - P fx̃ = x g = Â P fỹ = z " x g - P fx̃ = x g


x 2x̃ (W) x 2x̃ (W)

= Â fỹ (z " x )fx̃ (x ), for z 2 z̃ (W), with z " x 2 ỹ (W),


x 2x̃ (W)

where the third equality comes from the theorem of total probability
and the fourth from the independence between x̃ and ỹ . Note that, if
these two variables where not independent, then we will have that
P fx̃ + ỹ = z jx̃ = x g = P fx + ỹ = z jx̃ = x g , which is not
necessarily equal to P fx + ỹ = z g .

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 14 / 36


(b) We know that the distribution function Fz̃ of the absolutely
continuous random variable z̃ = x̃ + ỹ is
Z Z
Fz̃ (z ) = Fỹ (z " x )dFx̃ (x ) = Fỹ (z " x )fx̃ (x )dx.
R R

Di§erentiating the last expression with respect to z, and exchanging the


order of di§erentiation and integration, we obtain the density of the
random variable z̃ = x̃ + ỹ ,
Z
dFz̃ (z ) dFỹ (z " x )
fx̃ +ỹ (z ) = fz̃ (z ) = = fx̃ (x )dx
dz R dz
Z
= fỹ (z " x )fx̃ (x )dx, for z 2 R. Q.E .D.
R

See the handout for a non-trivial application of the previous


proposition to the convolution of two independent absolutely
continuous random variables.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 15 / 36


5.5. The density of a vector-valued function of an
absolutely continuous random vector.

Let x̃ : (W, F ) "! (Rm , B (Rm )) be a random vector with density


fx̃ : Rm "! R and g : (Rm , B (Rm )) "! (Rn , B (Rn )) be a
vector-valued Borel measurable function. Then the distribution Pỹ of
the random vector ỹ = g (x̃ ) : (W, F ) "! (Rn , B (Rn )) is given by
# $ Z Z
Pỹ (B ) = Px̃ g "1 (B ) = dPx̃ = fx̃ (x )dx,
g "1 (B ) g "1 (B )

where x = (x1 , x2 , ..., xn ) 2 Rm , for all B 2 B (Rn ) .

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 16 / 36


/ Let m = n and assume now that (i) the function
g : (Rn , B (Rn )) "! (Rn , B (Rn )) restricted to the (open) set A of
values of its domain satisfying fx̃ (x ) 6= 0, g : A "! g (A), is a one-to-one
correspondence (or bijective function), and (ii) the inverse function
g "1 : g (A) "! A is continuously di§erentiable (which implies that g (A)
is open as A is open). Then, the density function fỹ of the absolutely
continuous random vector ỹ = g (x̃ ) : (W, F ) "! (Rn , B (Rn )) is given
by 8 1 1
< fx̃ (g "1 (y )) 1Jg "1 (y )1 for y 2 g (A)
fỹ (y ) =
:
0 otherwise.
! 1 # $ "
/ Proof: For every Borel set B 1 g (A) . y 2 Rn 1fx̃ g "1 (y ) 6= 0 ,
# $ Z Z 1 1
Pỹ (B ) = Px̃ g "1 (B ) = fx̃ (x )dx = fx̃ (g "1 (y )) 1Jg "1 (y )1dy ,
g "1 (B ) B | {z }
fỹ (y )

where x = (x1 , x2 , ..., xn ) 2 Rn and y = (y1 , y2 , ..., yn ) 2 Rn . Q.E .D.


J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 17 / 36
Example: Let z̃ , N(0, 1) and ỹ = h (z̃ ) = z̃ 2 . Find the density of
ỹ .

Note that h : R "! R is not a one-to-one correspondence. However,


we can make ỹ = g (x̃ ) = x̃ 2 , where x̃ = jz̃ j and, then,
g : R + "! R + is a one-to-one correspondence, whose inverse is
x̃ = g "1 (ỹ ) = ỹ 1/2 and

dx dg "1 (y ) 1
= = y "1/2 > 0.
dy dy 2

Recall that the density of x̃ is


8
< 2n(x; 0, 1) for x > 0
fx̃ (x ) =
:
0 for x * 0.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 18 / 36


Then,
8 # $
< 2n(y 1/2 ; 0, 1) - 12 y "1/2 = n(y 1/2 ; 0, 1) - y "1/2 for y > 0
fỹ (y ) =
:
0 for y * 0.

Note that
1 1 1/2 2 1
n(y 1/2 ; 0, 1) - y "1/2 = p e " 2 (y ) - y "1/2 = p e " 2 y - y "1/2 .
1

2p 2p

Therefore,
8
> 1 " 1 y "1/2
>
< p e 2 y for y > 0
fỹ (y ) = 2p
>
>
:
0 for y * 0.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 19 / 36


Recall also that a random variable ỹ :(W, F ) ! (R,#B) has the
$ c2
(chi-square) distribution with n degrees of freedom ỹ , c2n if its
density is
8
> 1 n "2
"y /2 for y > 0
>
< n/2 # n $ y 2 e
2 G 2
fỹ (y ) =
>
>
:
0 otherwise.

Then, ỹ , c21 if
8
> 1 "1/2 e "y /2 = p1 e "y /2 y "1/2 for y > 0
>
< 1/2 # 1 $ y
2 G 2 2p
fỹ (y ) =
>
>
:
0 otherwise.

Therefore, the random variable ỹ = z̃#2 , with $z̃ , N(0, 1), is


chi-square with 1 degree of freedom ỹ , c21 .
J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 20 / 36
Even if m > n we can apply this method by introducing additional
variables to enlarge the dimension of the image space and, thus, to
make the function g a one-to-one correspondence for all the values
x 2 Rm of the domain of g for which fx̃ (x ) 6= 0. Then, we will need
to compute the marginal density to get rid of the additional variables
we have introduced. See the handout.

Note that, in order to Önd the density of ỹ = g (x̃ ) we could Önd Örst
the distribution function of ỹ from the density of x̃ and, then, by
performing the corresponding derivative, we obtain the density of ỹ
(distribution function method). This method does not require that
g be a bijection for all the values x 2 Rn of the domain of g for
which fx̃ (x ) 6= 0 (see Section 5.2).

In this Section 5.5 we Önd the density of ỹ = g (x̃ ) directly from the
density function of x̃ (density function method). This method
requires that g be a bijection for all the values x 2 Rn of the domain
of g for which fx̃ (x ) 6= 0.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 21 / 36


5.6. The characteristic function, moment-generating
function, and Laplace transform of a function of a random
variable
If ỹ = g (x̃ ) , then we can compute the characteristic function of ỹ ,
jỹ (or Mỹ or Lỹ if they are well-deÖned in a neighborhood of t = 0),
using the distribution of x̃,
Z
jỹ (t ) = E(e it ỹ ) = E(e itg (x̃ ) ) = e itg (x ) dPx̃ (x ),
R
Z
Mỹ (t ) = E(e t ỹ ) = E(e tg (x̃ ) ) = e tg (x ) dPx̃ (x ),
R
Z
Lỹ (t ) = E(e "t ỹ ) = E(e "tg (x̃ ) ) = e "tg (x ) dPx̃ (x ),
R
and try to identify the distribution Pỹ associated with jỹ (or with Mỹ
or with Lỹ ).
This is called the characteristic function (or moment-generation
function or Laplace transform) method.
J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 22 / 36
5.7. Mixture distributions
Consider a discrete set of random variables fx̃j gNj =1 , with
x̃j : (W, F , P ) "! (R, B) for j = 1, ..., N, where N can be either a
Önite number or inÖnity.
DeÖnition. The random variable x̃ : (W, F , P ) "! (R, B) is a
(discrete) mixture of the random variables fx̃j gN
j =1 , if x̃ = x̃j with
probability pj .
Obviously, pj 2 [0, 1] and  pj = 1.
j

The distribution of x̃ is called the mixture distribution and the


random variables fx̃j gNj =1 in the mixture are called the components
of the mixture.
Notation for a mixture:
x̃ = (p1 3 x̃1 ) 4 (p2 3 x̃2 ) 4 (p3 3 x̃3 ) 4 ...

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 23 / 36


Proposition. Assume that the component x̃j of the mixture x̃ has
the distribution Pj : B "! [0, 1] for j = 1, ..., N. Then, the mixture
distribution Px̃ is

Px̃ (B ) = Â pj Pj (B ), for all B 2 B .


j

Proof.

Px̃ (B ) = Â pj P fx̃ 2 B jx̃ = x̃j g


j

= Â pj P fx̃j 2 B g = Â pj Pj (B ), for all B 2 B ,


j j

where the Örst equality comes from the theorem of total probability.
Q.E .D.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 24 / 36


Corollary. Assume that the component x̃j of the mixture x̃ has the
distribution function Fj : R "! [0, 1] for j = 1, ..., N. Then, the
distribution function Fx̃ of the mixture distribution is

Fx̃ (x ) = Â pj Fj (x ), for x 2 R.
j

Proof. Using the previous proposition we get

Fx̃ (x ) = P fx̃ * x g = Px̃ ("•, x ] = Â pj Pj ("•, x ]


j

= Â pj P fx̃j * x g = Â pj Fj (x ), for x 2 R. Q.E .D.


j j

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 25 / 36


Corollary. Assume that the component x̃j of the mixture x̃ is discrete
with the probability function fj : x̃j (W) "! [0, 1] for j = 1, ..., N.
Then, the mixture distribution is discrete with the probability function
[
fx̃ (x ) = Â pj fj (x ), for x 2 x̃ (W) . x̃j (W) ,
j j

/ x̃j (W) .
where we make fj (x ) = 0 if x 2

Proof. Using again the proposition we get

fx̃ (x ) = P fx̃ = x g = Â pj P fx̃j = x g = Â pj fj (x ), for x 2 x̃ (W) .


j j
Q.E .D.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 26 / 36


Proposition. Assume that the component x̃j of the mixture x̃ is
absolutely continuous with the density fj : R "! R for j = 1, ..., N.
Then, the mixture distribution is absolutely continuous with the
density
fx̃ (x ) = Â pj fj (x ), for x 2 R.
j

Proof. Since the distribution function of the mixture satisÖes


Fx̃ (x ) = Â pj Fj (x ), we can take the derivative with respect to x to
j
obtain the density of the mixture x̃,
" #
d  pj Fj (x )
dFx̃ (x ) j
fx̃ (x ) = =
dx dx
dFj (x )
= Â pj = Â pj fj (x ), for x 2 R. Q.E .D.
j dx j

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 27 / 36


Note that the distribution of a mixture of random variables is not the
same as the distribution of their weighted sum.

Example: # Consider
$ the two independent
# $ random variables
x̃1 , N µ1 , s21 and# x̃2 , N µ 2 , s 2 . Then,
2 $
p1 x̃1 + p2 x̃2 , N p1 µ1 + p2 µ2 , p12 s21 + p22 s22 , while
x̃ = (p1 3 x̃1 ) 4 (p2 3 x̃2 ) is not normal.

µ1 = 5, s1 = 1, µ2 = 8, s2 = 3, p1 = 0.4, p2 = 0.6.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 28 / 36


Densities of x̃1 and x̃2 , n(x; 5, 1) and n(x; 8, 3), respectively:

f 0.4

0.3

0.2

0.1

-2 0 2 4 6 8 10 12 14 16 18
x

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 29 / 36


Density
5 of the weighted
q sum p1 x̃1 7 + p2 x̃2 :
n x; p1 µ1 + p2 µ2 , p1 s1 + p2 s2 = n(x; 6.8, 1.8439) :
2 2 2 2

0.25
f

0.20

0.15

0.10

0.05

-1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
x

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 30 / 36


Density of the mixture x̃ = (p1 3 x̃1 ) 4 (p2 3 x̃2 ) :
0.6n(x; 5, 1) + 0.4n(x; 8, 3) :

f
0.15

0.10

0.05

0 2 4 6 8 10 12 14 16 18 20 22 24
x

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 31 / 36


Proposition. Assume that the component x̃j of the mixture x̃ has
the Önite mean µj (i.e., x̃j 2 L1 ) for j = 1, ..., N. Then, the mean µ
of the mixture distribution is

µ= Â pj µj .
j

Proof.

µ = E (x̃ ) = Â pj E (x̃ jx̃ = x̃j ) = Â pj E (x̃j ) = Â pj µj ,


j j j

where the second equality comes from the theorem of total


expectation. Q.E .D.

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 32 / 36


Proposition. Assume that the component x̃j of the mixture x̃ has
the Önite mean µj and the Önite variance s2j (i.e., x̃j 2 L2 ) for
j = 1, ..., N, and let µ = Â pj µj be the mean of the mixture x̃. Then,
j
the variance s2 of the mixture distribution is
5 7 5 7
s2 = Â pj s2j + µ2j " µ2 = Â pj s2j + µ2j " µ2 . (Exercise)
j j

Proposition. Assume that the component x̃j of the mixture x̃ has a


Önite kth central moment (i.e., x̃j 2 Lk ) and the Önite mean µj for
j = 1, ..., N, and let µ = Â pj µj be the mean of the mixture x̃. Then,
j
the kth central moment of the mixture is given by
h i
E (x̃ " µ)k =
* +5 !
k
k 7k "n h5 7n i
 pj  µj " µ E x̃j " µj . (Exercise)
j n =0 n

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 33 / 36


General mixtures (not necessarily discrete)

Consider a set of random variables. A generic element of this set is


x̃q , where q 2 Q 1 Rn . The index set Q can be either discrete or
continuous. The distribution of the random variable x̃q is
Pq : B "! [0, 1] , for q 2 Q.

Consider also a probability P on (Rn , B) , where Q 2 B with


P (Q) = 1.

In the mixture x̃, the random variables x̃q , with q 2 Q, are "mixed"
according to the probability P.

Thus, the mixture distribution Px̃ is


Z Z
Px̃ (B ) = Pq (B )dP (q ) = Pq (B )dP (q ), for all B 2 B .
Q Rn

The previous two integrals are equal since the probability P is


concentrated on Q.
J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 34 / 36
If the random variables x̃q , for q 2 Q, are discrete (absolutely
continuous) with probability function (density) fq , then the probability
function (density) of the mixture distribution is
Z Z
fx̃ (x ) = fq (x )dP (q ) = fq (x )dP (q ).
Q Rn

Moreover, if µq = E (x̃q ) and s2q = Var (x̃q ) , for q 2 Q, then the


mean of the mixture x̃ is
Z
µ = E (x̃ ) = µq dP (q )
Q

and the variance of the mixture x̃ is


Z # $ Z # $
s2 = Var (x̃ ) = s2q + µ2q " µ2 dP (q ) = s2q + µ2q dP (q ) " µ2 .
Q Q

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 35 / 36


Particular case. Assume now that the probability P on (Rn , B) is
absolutely continuous with respect to Lebesgue measure with the
density f : Rn "! R so that
Z
P (C ) = f (q )d q, for all C 2 B .
C

Assume also that each component x̃q of the mixture x̃ is also


absolutely continuous with the density fq : R "! R, for q 2 Q 1 Rn .
Then, the mixture distribution is absolutely continuous with the
density
Z Z
fx̃ (x ) = fq (x )dP (q ) = fq (x )f (q )d q, for x 2 R,
Q Rn
with the mean Z
µ = E (x̃ ) = µ q f ( q )d q
Rn
and the variance
Z # $ Z # $
s2 = Var (x̃ ) = s2q + µ2q " µ2 f (q )d q = s2q + µ2q f (q )d q " µ2 .
Rn Rn

J. CaballÈ (UAB - MOVE - BSE) Probability and Statistics IDEA 36 / 36


Example of Convolution

Consider two independent, absolutely continuous random variables x~1 and x~2
having both the uniform density on (0; #) ;
8
> 1
< for xi 2 (0; #)
x~i !fi (xi ) = f (xi ) = #
>
:
0 elsewhere,

for i = 1; 2: Let us Önd the density fx~1 +~x2 of their sum, x~1 + x~2 : This density will
characterize the distribution of x~1 + x~2 (i.e., the convolution of x~1 and x~2 ).
Let us deÖne the random variable y~ = x~1 + x~2 : The density fy~ of y~ is the
following:
Z Z
fy~(y) = fx~1 +~x2 (y) = fx~2 (y # x1 )fx~1 (x1 )dx1 = f (y # x1 )f (x1 )dx1 :
R R

Note that f (y # x1 ) is equal to 1=# if y # x1 2 (0; #) and is equal to zero


otherwise. Moreover, f (x1 ) is equal to 1=# if x1 2 (0; #) and is equal to zero
otherwise. Therefore, f (y # x1 )f (x1 ) is equal to (1=#)2 if y # x1 2 (0; #) and
x1 2 (0; #) while it is equal to zero otherwise. Note that the set C $ R2 where
f (y # x1 )f (x1 ) = (1=#)2 6= 0 is given by the points (y; x1 ) satisfying the following
two inequalities:
x1 < y < x1 + # () y # # < x1 < y
and
0 < x1 < #
This set C is given by the interior of the shaded region in the following Ögure:

Therefore, the density of the convolution for y 2 (0; 2#) is


Z Z
fx~1 +~x2 (y) = fy~(y) = IC (y; x1 ) f (y # x1 )f (x1 )dx1 = f (y # x1 )f (x1 )dx1 ;
R C(y)

1
where C(y) is the section of y; C(y) = fx 2 R j(x; y) 2 C g. Thus,
8 Z y
> 1 1
>
> 2 dx1 = 2 y; for 0<y+#
>
> 0 # #
>
>
>
< Z
%
fx~1 +~x2 (y) = fy~(y) = 1 1 2
>
> 2 dx1 = # 2 y + ; for # < y < 2#;
>
> y!% # # #
>
>
>
>
:
0 elsewhere,

whose graph is

This type of densities (and their corresponding distributions) are called


"triangular" for obvious reasons.

2
Examples of densities of functions of random vectors

Example 1.
Assume that the joint density function of the random variables x~1 and x~2 is
8 !(x +x )
< e 1 2 for x1 > 0; x2 > 0
fx~1 ;~x2 (x1 ; x2 ) =
:
0 otherwise.
x~1
Find the density function of the random variable y~ = .
x~1 + x~2
x1
Solution: For each given value of x1 , is strictly decreasing in x2 .
x1 + x2
Therefore, we can deÖne the bijective function g : R++ ! R++ "! (0; 1) ! R++
as 8 x1
>
< y= 2 (0; 1)
x1 + x2
(y; z) = g(x1 ; x2 ) :
>
:
z = x1 > 0;
and thus g !1 : (0; 1) ! R++ "! R++ ! R++ is given by
8
>
> x =z>0
< 1
(x1 ; x2 ) = g !1 (y; z) :
>
> z(1 " y)
: x2 = > 0:
y
The joint density of y~ and z~ is given by
8
< fx~1 ;~x2 (g !1 (y; z)) jJg!1 (y; z)j for y 2 (0; 1); z > 0
fy~;~z (y; z) =
:
0 otherwise,
where,
% 0 @x %
% 1 @x1 1% %% 0 1%
%
% % % 0 1 % % %
% B @y @z C % % B C% % z %
% B
jJg!1 j = %det B
C% %
C% = %det B C% = % % = z > 0:
% @ z 1 " y A%% % y 2 % y 2
%
@ @x
2 @x2 A%% % " 2
% % % y y %
@y @z
z(1 " y) z
Therefore, since x1 + x2 = z + = ; we get
y y
8
> !z=y z
< e for y 2 (0; 1) and z > 0
y2
fy~;~z (y; z) =
>
:
0 otherwise

1
The set A where fx~1 ;~x2 (x1 ; x2 ) 6= 0 is deÖned by the points (x1 ; x2 ) 2 R
satisfying the following two inequalities:
x1 > 0 and x2 > 0:
Thus, the set g(A) where fy~;~z (y; z) 6= 0 is deÖned by the points (y; z) 2 R
satisfying the following two inequalities:
0 < y < 1 and z > 0:
The marginal density of y~ is
Z 1 Z 1
z
fy~(y) = fy~;~z (y; z)dz = e!z=y dz; if y 2 (0; 1)
!1 0 y2
and fy~(y) = 0; otherwise.
z dz
Let us make a change of variable: u = , z = yu ) = y 2 (0; 1):
y du
Z 1 Z 1
!u u
=) fy~(y) = e y du = e!u u du = )(2) = (2 " 1)! = 1 if y 2 (0; 1):
0 y 0

Alternatively, note that we can integrate by parts,


Z 1 Z 1 Z
!u
- !u .1 !u
1
e u du = "e u 0 " "e du = 0 + e!u du
0 0 0
- .1
= "e!u 0 = 0 " ("1) = 1:
8
< 1 for y 2 (0; 1)
=) fy~(y) =
:
0 otherwise.
Therefore, y~ is uniform on (0; 1) :
Note that, in this example, we can name the new variable z~ with the old name
x~1 so that the function g would be
8 x1
>
< y= 2 (0; 1)
x1 + x2
(y; x1 ) = g(x1 ; x2 ) :
>
:
x1 = x1 > 0:

Example 2.
Assume that the two independent random variables x~1 and x~2 have both the
uniform density on (0; 0) ;
8
> 1
< for xi 2 (0; 0)
x~i )fi (xi ) = f (xi ) = 0
>
:
0 elsewhere,

2
for i = 1; 2: Find the density function of the random variable y~ = x~1 + x~2 : Note
that this is the same example as in the previous handout on convolutions.
Solution: From independence, we obtain the joint density of x~1 and x~2 ;
8
> 1
< 2 for x1 2 (0; 0) and x2 2 (0; 0)
fx~1 ;~x2 (x1 ; x2 ) = f (x1 ) * f (x2 ) = 0
>
:
0 elsewhere,
We have
8 8
< y = x1 + x2 2 (x1 ; x1 + 0) < x1 = z 2 (0; 0)
g: =) g !1 :
: :
z = x1 2 (0; 0) x2 = y " z 2 (0; 0)

Note that y " z 2 (0; 0) () y 2 (z; z + 0) () z 2 (y " 0; y) :


% 0 @x %
% 1 @x1 1% % 0 1%
% %
% B @z @y C% %% 1 0 %%
% B C% % A% = 1:
jJg!1 (y; z)j = %det B C% = %det @ %
% @ @x A
@x2 % % %
% 2 "1 1 %
% %
@z @y
Then,
1 1
fy~;~z (y; z) = 2 * 1 = 2 ; for 0 < z < 0 and y " 0 < z < y:
0 0
Therefore,
8
> 1
< 2 for 0 < z < 0 and y " 0 < z < y
fy~;~z (y; z) = 0
>
:
0 elsewhere

The set A where fx~1 ;~x2 6= 0 is deÖned by the points (x1 ; x2 ) 2 R satisfying the
following two inequalities:

0 < x1 < 0 and 0 < x2 < 0:

Thus, the set g(A) where fy~;~z 6= 0 is deÖned by the points (y; z) 2 R satisfying
the following two inequalities:

0 < z < 0 and z < y < z + 0

or, equivalently, the following two inequalities:

0 < z < 0 and y " 0 < z < y:

Therefore, g(A) = C; where the set C is given by the interior of the shaded region
in the following Ögure:

3
Then, the density of y for y 2 (0; 20) is
Z 1 Z Z
fy~(y) = fy~;~z (y; z) dz = IC (y; z) fy~;~z (y; z)dz = fy~;~z (y; z) dz;
!1 | {z }
R 1=*2 C(y)

where C(y) is the section of y; C(y) = fz 2 R j(y; z) 2 C g. Therefore


8 Z y
> 1 1
>
> 2 dz = 2 y; for 0 < y . 0
>
> 0 0 0
>
>
>
< Z
*
fx~1 +~x2 (y) (y) = 1 1 2
>
> 2 dz = " 2 y + ; for 0 < y < 20;
>
> y!* 0 0 0
>
>
>
>
:
0 elsewhere,
so that the density is "triangular",

Again, in this example, we can name the new variable z~ with the old name x~1
so that the function g would be
8
< y = x1 + x2 2 (x1 ; x1 + 0)
(y; x1 ) = g(x1 ; x2 ) :
:
x1 = x1 2 (0; 0):

You might also like