Try   HackMD

Introduction

這篇主要是介紹怎麼轉換
以數學式來說就是 :
已知

X Y=g(x)

Transformation of Random Variables

我們先假設

X 有一個
pmf:FX(x)

接著定義
Y=g(X)

我們就可以得到
x=g1(y)

然後也可以知道 :
fY(y)=fX(g1(y))

另外,我們假設

X 是 continuous variable 並且 pdf 是
fX(x)

Y=g(X)
然後
x=g1(y)

我們就可以知道
Y
的 pdf 是 :
fY(y)=fX(g1(y))|dg1(y)dy|

Comparison

  • discrete pmf (

    \colorredprobability) :
    fY(y)=fX(g1(y))

  • continuous pdf (

    \colorreddensity) :
    fY(y)=fX(g1(y))|dg1(y)dy|

Examples

Question 1 (
g
is one to one)(discrete)

question : find

pmf of
Y=g(X)=eX, with P(X=1)=P(X=1)=14, P(X=0)=12

solution :
從題目我們可以知道我們想求出

fY(y)=?
首先我們最簡單的方式就是畫關係圖出來 :
Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

我們可以先知道 :
y{e1, e0, e1}

然後算出

fY(e1)=P(Y=e1)=P(X=1)\colorgreenP(X=g1(e1))=P(X=lne1)=1/4
fY(e1)
同理
fY(e0)=P(Y=e0)=P(X=0)=1/2

 In general, 

f\colorredY(y)=P(Y=y)=P(eX=y)=P(X=ln(y))\colorgreenP(g(X)=y) = P(X=g1(y))=f\colorredX(ln(y))

Question 2 (
g
is not one to one)(discrete)

question : find

pmf of
Y=g(X)=X2, with P(X=1)=P(X=1)=14, P(X=0)=12

solution :
我們可以先知道 :

y{0, 1}

然後算出

fY(0)=P(Y=0)=P(X=0)=1/2
fY(1)=P(Y=1)= y=x2=1  x=±1P(X=1)+P(X=1)=1/4+1/4=1/2

fY(1)=P(Y=1)=P(g(x)=1)={P(x=g11(1)\colororangey=x2x= y=g1(y))=P(x=1)=1/4P(x=g11(1)\colororangey=x2x= y=g2(y))=P(x=1)=1/4

Question 3 (continuous case)

question : assume

XF, find pdf of
Y=g(X)

solution :

FY(y)=P(Yy)=P(g(x)y)
我們可以先分段討論

  • g is increasing
    F\colorredY(y)=...=P(g(x)=Yy)=P(xg1(y))=F\colorredX(g1(y))

    接著轉換成 pdf
    fY(y)=ddyFX(g1(y))=fX(g1(y))×dg1(y)dy=fX(g1(y))×|dg1(y)dy|

  • g is decreasing
    F\colorredY(y)=...=P(g(x)=Yy)=P(xg1(y))=1F\colorredX(g1(y))

    接著轉換成 pdf
    fY(y)=ddy[1FX(g1(y))]=fX(g1(y))×dg1(y)dy<0=fX(g1(y))×|dg1(y)dy|

Question 4 (
g
is one to one)(continuous)

question : find

pdf of
Y=g(X)=log(X), with XfX(x)=ex, x>0

solution :
我們可以先確定

YR
然後有 2 種解題方式 :

  • From scratch :

    FY(y)=P(Yy)=P(log(X)y)\colorgreenelog(X)ey=P(Xey)=0eyfX(x)dx
    接著我們是想求出 pdf,所以把
    FY(y)
    微分
    fY(y)=ddy0eyfX(x)dx= FX=fX(x)ddy[FX(ey)F(0)]=fX(ey)d eyd y=eeyey

  • From formula :

    y=g(x)=log(x), x=g1(y)=ey
    fY(y)=fX(g1(y))|dg1(y)dy|=eeyey

    Image Not Showing Possible Reasons
    • The image was uploaded to a note which you don't have access to
    • The note which the image was originally uploaded to has been deleted
    Learn More →