Probability/Transformation of Random Variables

From testwiki
Revision as of 12:39, 2 February 2024 by 14.139.251.153 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision β†’ (diff)
Jump to navigation Jump to search

Template:Nav


Transformation of random variables

Underlying principle

Let X1,,Xn be n random variables, Y1,,Yn be another n random variables, and 𝐗=(X1,,Xn)T,𝐘=(Y1,,Yn)T be random (column) vectors.

Suppose the vector-valued function[1] 𝐠:supp(𝐗)supp(𝐘) is bijective (it is also called one-to-one correspondence in this case). Then, its inverse 𝐠1:supp(𝐘)supp(𝐗) exists.

After that, we can transform 𝐗 to 𝐘 by applying the transformation 𝐠, i.e. by 𝐘=𝐠(𝐗), and transform 𝐘 to 𝐗 by applying the inverse transformation 𝐠1, i.e. by 𝐗=𝐠1(𝐘).

We are often interested in deriving the joint probability function f𝐘(𝐲) of 𝐘, given the joint probability function f𝐗(𝐱) of 𝐗. We will examine the Template:Colored em and Template:Colored em cases one by one in the following.

Transformation of discrete random variables

Template:Colored proposition

Proof. Considering the original pmf f𝐘(𝐲), we have f𝐘(𝐲)= def β„™(𝐘=𝐲)=β„™(𝐠1(𝐘)=𝐠1(𝐲))=β„™(𝐗=𝐠1(𝐲))= def f𝐗(𝐠1(𝐲)),𝐲supp(𝐘). In particular, the inverse 𝐠1 exists since 𝐠 is bijective.


Transformation of continuous random variables

For Template:Colored em random variables, the situation is more complicated.

Let us investigate the case for univariate pdf, which is simpler. Template:Colored theorem

Proof. Under the assumption that g is differentiable and strictly monotone, the cdf FY(y)=β„™(g(X)y)={β„™(Xg1(y))=FX(g1(y)),g1 is increasing;β„™(Xg1(y))=1FX(g1(y)),g1 is decreasing. (g1 exists since g is strictly monotonic.) Differentiating both side of the above equation (assuming the cdf's involved are differentiable) gives fY(y)={fX(g1(y))dg1(y)dy,g1 is increasing;fX(g1(y))dg1(y)dy,g1 is decreasing. Since x=g1(y), we can write dg1(y)dy as dxdy. Also, we can summarize the above case defined function into a single expression by applying absolute value function to both side: fY(y)=fX(g1(y))|dxdy|, where the absolute value sign is only applied to dxdy since the pdf's must be nonnegative, and thus we do not need to apply the sign to them.

Template:Colored remark Let us define Template:Colored em, and introduce several notations in the definition. Template:Colored definition Template:Colored remark Template:Colored example

Template:Colored theorem

Proof. Template:Colored em: Assume 𝐠 is differentiable and bijective.

First, β„™(YS)=Sf𝐘(𝐲)dy1dyn(1).

On the other hand, we have β„™(YS)=β„™(X=𝐠1(Y)𝐠1(S))=𝐠1(S)f𝐗(𝐱)dx1dxn where 𝐠1(S)={xX:𝐠(x)S}, which is the preimage of the set S under 𝐠.

Applying the change of variable formula to this integral (whose proof is advanced and uses our assumptions), we get 𝐠1(S)f𝐗(𝐱)dx1dxn=Sf𝐗(𝐠1(𝐲))|det𝐱𝐲|dy1dyn(2) Comparing the integrals in (1) and (2), we can observe the desired result.


Moment generating function

Template:Colored definition Template:Colored remark Template:Colored proposition

Proof.

  • Since

MX(t)=𝔼[etX]=𝔼[1+tX+t2X22!+]=linearity1+t𝔼[X]+t22!𝔼[X2]+, dndtnMX(t)|t=0=dndtn(1+t𝔼[X]+t22!𝔼[X2]+)|t=0=𝔼[X]dndtnt+𝔼[X2]2!dndtnt2+,

  • The result follows from simplifying the above expression by dndtntm=𝟏{m=n}n!+𝟏{mn}(0).

Template:Colored proposition

Proof. MXY(t)=𝔼[etXY]=lote𝔼X[𝔼Y[etXY|X]]=𝔼X[MY(tX)]. Similarly, MXY(t)=𝔼[etXY]=lote𝔼X[𝔼X[etXY|Y]]=𝔼Y[MX(tY)].

  • lote: law of total expectation

Template:Colored remark

Joint moment generating function

In the following, we will use 𝐗 to denote (X1,,Xn)T. Template:Colored definition Template:Colored remark Template:Colored proposition

Proof. 'only if' part: Assume X1,,Xn are independent. Then, M𝐗(𝐭)=𝔼[e𝐭𝐗]=𝔼[et1X1etnXn]= independence π”Ό[et1X1]𝔼[etnXn]=MX1(t1)MXn(tn). Proof for 'if' part is quite complicated, and thus is omitted.

Analogously, we have Template:Colored em mgf. Template:Colored definition Template:Colored proposition

Proof. Mπšπ—+b(t)=𝔼[etπšπ—+bt]=ebt𝔼[etπšπ—]=ebtM𝐗(t𝐚)=ebtM𝐗(ta1,,tan).

Template:Colored remark

Moment generating function of some important distributions

Template:Colored proposition

Proof. MX(t)=k=0netk(nk)pk(1p)nkforBinom(n,p)=k=0n(nk)(pet)k(1p)nk=(pet+1p)nby binomial theorem.

Template:Colored proposition

Proof. MX(t)= def π”Ό[etX]= LOTUS k=0etkeλλkk!forPois(λ)=eλ(et1)k=0eλet(λet)kk!forPois(λet)=1=eλ(et1).

Template:Colored proposition

Proof.

  • MX(t)=𝔼[etX]=λ0etxeλxdx=λ0e(λt)xdx=λλt0(λt)e(λt)xforExp(λt)dx=1,λt>0ensuring valid rate parametert<λ.
  • The result follows.

Template:Colored proposition

Proof.

  • We use similar proof technique from the proof for mgf of exponential distribution.

MX(t)=𝔼[etX]=λαΓ(α)0etxxα1eλxdx=λαΓ(α)0e(λt)xxα1dx=λα(λt)α0(λt)αΓ(α)e(λt)xxα1forGamma(α,λt)dx=1,λt>0ensuring valid rate parametert<λ.

  • The result follows.

Template:Colored proposition

Proof.

  • Let Z=Xμσ𝒩(0,1). Then, X=σZ+μ.
  • First, consider the mgf of Z:

MZ(t)= def π”Ό[etZ]=12πetxex2/2=e(x22tx)/2dx=12πexp((x22tx+t2)=(xt)2/2+t2/2)dx=et2/212πe(xt)2/2for π’©(t,1)dx=1=et2/2.

  • It follows that the mgf of X is

MX(t)=eμtMX(σt)=eμteσ2t2/2.

  • The result follows.


Distribution of linear transformation of random variables

We will prove some propositions about distributions of linear transformation of random variables using Template:Colored em. Some of them are mentioned in previous chapters. As we will see, proving these propositions using mgf is quite simple. Template:Colored proposition

Proof.

  • The mgf of aX+b is

MaX+b(t)=ebtMX(at)=ebt(exp(aμt+(aσ)2t2/2))=exp((aμ+b)t+a2σ2t2/2),

which is the mgf of 𝒩(aμ+b,a2σ2), and the result follows since mgf identify a distribution uniquely.

Sum of independent random variables

Template:Colored proposition

Proof.

  • The mgf of X1++Xn is

MX1++Xn(t)=MX1(t)MXn(t)=(pet+1p)n1(pet+1p)nm=(pet+1p)n1++nm,

which is the mgf of Binom(n1++nm,p), as desired.

Template:Colored proposition

Proof.

  • The mgf of X1++Xn is

MX1++Xn(t)=MX1(t)MXn(t)=eλ1(et1)eλn(et1)=e(λ1++λn)(et1),

which is the mgf of Pois(λ1++λn), as desired.

Template:Colored proposition

Proof.

  • The mgf of X1++Xn is

MX1++Xn(t)=MX1(t)MXn(t)=(λλt)n,

which is the mgf of Gamma(n,λ), as desired.

Template:Colored proposition

Proof.

  • The mgf of X1++Xn is

MX1++Xn(t)=MX1(t)MXn(t)=(λλt)α1(λλt)αn=(λλt)α1++αn,

which is the mgf of Gamma(α1++αn,λ), as desired.

Template:Colored proposition

Proof.

  • The mgf of X1++Xn (in which they are independent) is

MX1++Xn(t)=MX1(t)MXn(t)=exp(μ1t+σ12t2/2)exp(μnt+σn2t2/2)=exp((μ1++μn)t+(σ12++σn2)t2/2),

which is the mgf of 𝒩(μ1++μn,σ12++σn2), as desired.


Central limit theorem

We will provide a proof to Template:Colored em (CLT) using mgf here. Template:Colored theorem

Proof.

  • Define Tn=n(Xnμ)σ. Then, we have

Tn=n((X1++Xn)/nμ)σ=X1++Xnσnnμσ,

  • which is in the form of πšπ—+b,𝐚=(1σn,,1σn)T and b=nμσ.
  • Therefore,

MTn(t)=enμt/σ(MX1(tσn)MXn(tσn))MTn(t)=enμt/σ(MX1(tσn))nsince X1,,Xn are identically distributed, which is equivalent to they have the same mgflnMTn(t)=nμt/σ+nln(𝔼[et/(σn)X1])=nμt/σ+nln𝔼[1+t/(σn)X1+(1/2!)t2/(σ2n)+]since ex=1+x+x22!+=nμt/σ+nln(1+t/(σn)𝔼[X]+(1/2!)t2/(σ2n)(𝔼[X2]Var(X)+(𝔼[X])2)+terms of order smaller than n1)=nμt/σ+nln(1+t/(σn)μ+(1/2)t2/(σ2n)(σ2+μ2)+terms of order smaller than n1)=nμt/σ+n[t/(σn)μ+(1/2)t2/(σ2n)(σ2+μ2)(1/2)(t/(σn)μ)2+terms of order smaller than n1]since ln(1+x)=xx2/2+=nμt/σ+nμt/σ+n(1/2)t2/(σ2n)(σ2+μ2)n(1/2)(t2/(σ2n)μ2)+terms of order smaller than n0=(1/2)t2(σ2/σ2)+(1/2)μ2t2(1/2)t2(μ2)+terms of order smaller than n0=(1/2)t2+terms of order smaller than n00 as nlimnMTn(t)=et2/2mgf of π’©(0,1), and the result follows from the mgf property of identifying distribution uniquely.

Template:Colored remark A special case of using CLT as Template:Colored em is using normal distribution to Template:Colored em discrete distribution. To improve accuracy, we should ideally have Template:Colored em, as explained in the following. Template:Colored proposition Template:Colored remark Illustration of continuity correcction:

| 
|              /
|             /
|            /
|           /|
|          /#|
|         *##|
|        /|##|
|       /#|##|   
|      /##|##|   
|     /|##|##|   
|    / |##|##|   
|   /  |##|##|
|  /   |##|##|
| /    |##|##|
*------*--*--*---------------------
    i-1/2 i i+1/2

| 
|              /
|             /
|            /
|           / 
|          /  
|         *   
|        /|   
|       /#|      
|      /##|      
|     /###|      
|    /####|      
|   /#####|   
|  /|#####|   
| / |#####|   
*---*-----*------------------------
   i-1    i      

| 
|              /|
|             /#|
|            /##|
|           /###|
|          /####|
|         *#####|
|        /|#####|
|       / |#####|
|      /  |#####|
|     /   |#####|
|    /    |#####|
|   /     |#####| 
|  /      |#####|
| /       |#####|
*---------*-----*------------------
          i     i+1 

Template:Nav

  1. ↑ or equivalently, transformation between supports of 𝐗 and 𝐘