跳至主要内容

隨機變量的變換(Transformations of Random Variables)

單變量變換

EX XB(n,p)X\sim B(n,p), let Y=nX=h(X)Y=n-X=h(X)

    fY(y)=P(Y=y)=P(nX=y)=P(X=ny)=(nny)pny(1p)y=(ny)py(1p)ny\implies f_Y(y)=P(Y=y)=P(n-X=y)=P(X=n-y)=\binom{n}{n-y}p^{n-y}(1-p)^y=\binom{n}{y}p^y(1-p)^{n-y}

i.e. YB(n,p)Y\sim B(n,p)


EX XN(μ,σ2)X\sim N(\mu,\sigma^2)

Y={1if Xμ1if X<μY=\begin{cases} 1 & \text{if } X\ge \mu\\ -1 & \text{if } X<\mu \end{cases}     fY(y)=P(Y=y)={P(Xμ)if y=1P(X<μ)if y=1=12\implies f_Y(y)=P(Y=y)= \begin{cases} P(X\ge \mu) & \text{if } y=1\\ P(X<\mu) & \text{if } y=-1 \end{cases}=\frac{1}{2}

對於連續的隨機變量變換, Xf(x),Y=h(x)X\sim f(x), Y=h(x)

    \implies cdf of YY is FY(y)=P(Yy)FY(y)=P(Y\le y) and pdf of YY is fY(y)=ddyFY(y)f_Y(y)=\frac{d}{dy}F_Y(y)

如果 h(x)h(x) 是單調遞增,則 h1(y)h^{-1}(y) 存在,並且微分為正

Fy(y)P(Yy)=P(h(X)y)=P(Xh1(y))=FX(h1(y))F_y(y)\triangleq P(Y\le y)=P(h(X)\le y)=P(X\le h^{-1}(y))=F_X(h^{-1}(y))     fY(y)=ddyFY(y)=ddyFX(h1(y))=fX(h1(y))ddyh1(y)>0\implies f_Y(y)=\frac{d}{dy}F_Y(y)=\frac{d}{dy}F_X(h^{-1}(y))=f_X(h^{-1}(y))\underbrace{\frac{d}{dy}h^{-1}(y)}_{>0}

如果 h(x)h(x) 是單調遞減,則 h1(y)h^{-1}(y) 存在,並且微分為負

Fy(y)P(Yy)=P(h(X)y)=P(Xh1(y))=1FX(h1(y))F_y(y)\triangleq P(Y\le y)=P(h(X)\le y)=P(X\ge h^{-1}(y))=1-F_X(h^{-1}(y))     fY(y)=ddyFY(y)=ddy(1FX(h1(y)))=fX(h1(y))ddyh1(y)<0\implies f_Y(y)=\frac{d}{dy}F_Y(y)=\frac{d}{dy}(1-F_X(h^{-1}(y)))=-f_X(h^{-1}(y))\underbrace{\frac{d}{dy}h^{-1}(y)}_{<0}
Theorem

如果 XX 有連續的 pdf fX(x)f_X(x), 並且 hh 是 1-1 ,且 h(x)h'(x) 存在連續導數,則 Y=h(X)Y=h(X) 有 pdf

fY(y)=fX(h1(y))ddyh1(y),yYf_Y(y)=f_X(h^{-1}(y))\left|\frac{d}{dy}h^{-1}(y)\right|, y\in \mathscr{Y}

其中 Y=h(X),X={x;fX(x)>0}\mathscr{Y}=h(\mathscr{X}), \mathscr{X}=\set{x;f_X(x)>0}

EX: XN(μ,σ2)X\sim N(\mu,\sigma^2), let Y=h(X)=Xμσ    X=σY+μ=h1(y)    ddyh1(y)=σY=h(X)=\frac{X-\mu}{\sigma}\iff X=\sigma Y+\mu=h^{-1}(y)\implies \frac{d}{dy}h^{-1}(y)=\sigma

fY(y)=fX(σy+μ)ddy(σy+μ)=12πey22yR\begin{align*} f_Y(y)&=f_X(\sigma y+\mu)\left|\frac{d}{dy}(\sigma y+\mu)\right|\\ &=\frac{1}{\sqrt{2\pi}}e^{-\frac{y^2}{2}}\quad \forall y\in\R \end{align*}

    YN(0,1)\implies Y\sim N(0,1)


EX: Let XGamma(α,β)X\sim \text{Gamma}(\alpha,\beta) with α>0,β>0\alpha>0,\beta>0 given, and Y=2Xβ=h(X)Y=\frac{2X}{\beta}=h(X)

    Y=h(X)=(0,)\implies \mathscr{Y}=h(\mathscr{X})=(0,\infty) and X=βY2h1(Y)X=\frac{\beta Y}{2}h^{-1}(Y)

fY(y)=fX(h1(y))ddyh1(y),yY=fX(βy2)β2,y>0=1Γ(α)βα(βy2)α1exp(βyββ2)=1Γ(α)2αyα1ey/2,y>0=pdf of Gamma(α,2)\begin{align*} f_Y(y)&=f_X(h^{-1}(y))\left|\frac{d}{dy}h^{-1}(y)\right|, y\in\mathscr{Y}\\ &=f_X\left(\frac{\beta y}{2}\right)\left|\frac{\beta}{2}\right|, y>0\\ &=\frac{1}{\Gamma(\alpha)\beta^\alpha}\left(\frac{\beta y}{2}\right)^{\alpha-1}\exp\left(-\frac{\beta y}{\beta}\cdot\frac{\beta}{2} \right)\\ &=\frac{1}{\Gamma(\alpha)2^\alpha}y^{\alpha-1}e^{-y/2}, y>0\\ &=\text{pdf of Gamma}(\alpha,2) \end{align*}

i.e. XGamma(α,β)    βXβGamma(α,β)X\sim \text{Gamma}(\alpha,\beta)\implies \frac{\beta^*X}{\beta}\sim \text{Gamma}(\alpha,\beta^*)


Remark:

  1. XGamma(k2,2)=χk2X\sim\text{Gamma}(\frac{k}{2},2)=\chi^2_k

  2. XGamma(α,β),Y=1XX\sim\text{Gamma}(\alpha,\beta), Y=\frac{1}{X}

    fY(y)=fX(1y)1y2=1Γ(α)βα(1y)α+1e1/βy,y>0\begin{align*} f_Y(y)=f_X(\frac{1}{y})\left|-\frac{1}{y^2}\right|=\frac{1}{\Gamma(\alpha)\beta^\alpha}(\frac{1}{y})^{\alpha+1}e^{-1/\beta y}, y>0 \end{align*}

        y\implies y has a inverse Gamma dist


EX: XU(a,b)X\sim U(a,b), and Y=Xaba=h(X)Y=\frac{X-a}{b-a}=h(X)

    Y=(0,1),X=(ba)Y+a=h1(y)\implies \mathscr{Y}=(0,1), X=(b-a)Y+a=h^{-1}(y)

    fY(y)=fX(h1(y))ddyh1(y),yY=1ba(b1)=1\begin{align*} \implies f_Y(y)&=f_X(h^{-1}(y))\left|\frac{d}{dy}h^{-1}(y)\right|, y\in\mathscr{Y}\\ &=\frac{1}{b-a}\cdot (b-1)=1 \end{align*}

i.e. YU(0,1)Y\sim U(0,1)


EX: UU(0,1),X=2lnU=h(U)(0,)    U=eX/2=h1(X)U\sim U(0,1), X=-2\ln U=h(U)\in(0,\infty)\implies U=e^{-X/2}=h^{-1}(X)

    fX(x)=fU(h1(x))ddxh1(x)=112ex/2=12ex/2,x>0\implies f_X(x)=f_U(h^{-1}(x))\left|\frac{d}{dx}h^{-1}(x)\right|=1\cdot\left|\frac{-1}{2}e^{-x/2}\right|=\frac{1}{2}e^{-x/2}, x>0

i.e. Xχ22    2lnUχ22X\sim\chi^2_2\implies -2\ln U\sim \chi^2_2


EX: ZsinN(0,1),Y=Z2=h(Z)Z\sin N(0,1), Y=Z^2=h(Z),變換並不是 1-1

h={z2z0z2z<0    h1={zz0zz<0h=\begin{cases} z^2 & z\ge 0\\ z^2 & z<0 \end{cases}\implies h^{-1}=\begin{cases} \sqrt{z} & z\ge 0\\ -\sqrt{z} & z<0 \end{cases}     FY(y)=P(Yy)=P(Z2y)=P(yZy)=Φ(y)Φ(y)\implies F_Y(y)=P(Y\le y)=P(Z^2\le y)=P(-\sqrt{y}\le Z\le \sqrt{y})=\Phi(\sqrt{y})-\Phi(-\sqrt{y}) fY(y)=ddyFY(y)=ddy[Φ(y)Φ(y)]=ϕ(y)ddyyϕ(y)ddy(y)=2ϕ(y)ddyy=212πey/212y1/2=1π21/2y121ey/2,y>0pdf of Gamma(12,2)\begin{align*} f_Y(y)&=\frac{d}{dy}F_Y(y)\\ &=\frac{d}{dy}[\Phi(\sqrt{y})-\Phi(-\sqrt{y})]\\ &=\phi(\sqrt{y})\frac{d}{dy}\sqrt{y}-\phi(-\sqrt{y})\frac{d}{dy}(-\sqrt{y})\\ &=2\phi(\sqrt{y})\frac{d}{dy}\sqrt{y}=2\cdot\frac{1}{\sqrt{2\pi}}e^{-y/2}\cdot\frac{1}{2}y^{-1/2}\\ &=\frac{1}{\sqrt{\pi}2^{1/2}}y^{\frac{1}{2}-1}e^{-y/2}, y>0\\ &\propto \text{pdf of Gamma}(\frac{1}{2},2) \end{align*}

i.e. Z2Gamma(12,2)=χ12Z^2\sim\text{Gamma}(\frac{1}{2},2)=\chi^2_1


Remark: 如果發現兩個 pdf 函數成比例(變數相關部分相同 x\forall x),則兩個 pdf 相同。

因為 pdf 積分為 1,如果變數部分相同,則常數部分一定相同。

Theorem

Let XX have a conti. pdf fX(x)f_X(x) and X={x:f(x)>0}\mathscr{X}=\set{x:f(x)>0} be the support of XX, Y=h(X)Y=h(X).

Suppose {A0,A1,,,Ak}\exist\set{A_0,A_1,,\cdot,A_k} :partition of X\mathscr{X} s.t. P(XA0)=0P(X\in A_0)=0 and suppose hi\exist h_i on Ai,i=1,2,,kA_i,i=1,2,\cdots,k with

  1. h(x)=hi(x),xAih(x)=h_i(x),\forall x\in A_i

  2. hih_i is monotone on AiA_i

  3. hi(Ai)={y:y=hi(x),xAi},ih_i(A_i)=\set{y:y=h_i(x),x\in A_i},\forall i

    Y=h(X)={y:y=h(x),xX}\mathscr{Y}=h(\mathscr{X})=\set{y:y=h(x),x\in\mathscr{X}}

  4. hi1(y)h_i^{-1}(y) has a conti derivative

then pdf of YY is

fY(y)=i=1kfX(hi1(y))ddyhi1(y),yYf_Y(y)=\sum_{i=1}^k f_X(h_i^{-1}(y))\left|\frac{d}{dy}h_i^{-1}(y)\right|, y\in\mathscr{Y}

XX 的 pdf 分段,使得每段有其對應的 1-1 變換函數 hih_i。將每段的 pdf 分別變換,然後合併。

Idea: Y=FX(X)[0,1]Y=F_X(X)\in[0,1]

FY(y)=P(Yy)=P(FX(X)y)=P(XFX1(y))=FX(FX1(y))=yF_Y(y)=P(Y\le y)=P(F_X(X)\le y)=P(X\le F_X^{-1}(y))=F_X(F_X^{-1}(y))=y     fY(y)=ddyFY(y)=1,y[0,1]\implies f_Y(y)=\frac{d}{dy}F_Y(y)=1, y\in[0,1]

U(0,1)U(0,1) 的 pdf

Theorem

UU(0,1)U\sim U(0,1) 並且 FF 是 cdf (不要求連續,但單調遞增),定義 F1(y)=inf{x;F(x)y}F^{-1}(y)=\inf\set{x;F(x)\ge y}

    XF\implies X\sim F

Lemma

上面定義的 F1F^{-1} 會有以下性質:

  1. F1F^{-1} 是單調遞增的(不一定嚴格遞增)
  2. F(F1(Y))y,y(0,1)F(F^{-1}(Y))\ge y,\forall y\in(0,1)
  3. F1(F(t))t,tF^{-1}(F(t))\le t,\forall t
  4. F1(y)t    yF(t),y(0,1),tRF^{-1}(y)\le t\iff y\le F(t),\forall y\in(0,1),\forall t\in\R

如果進一步, FF 是連續的,則 F(F1(t))=t,tF(F^{-1}(t))=t,\forall t

Proof:

P(XX)=P(F1(u)x)=P(uF(x))=F(x)P(X\le X)=P(F^{-1}(u)\le x)=P(u\le F(x))=F(x)

i.e. X 的 cdf 是 FF

Theorem

The prob integral transformation

XX 有連續的 cdf FXF_X,令 Y=FX(X)    YU(0,1)Y=F_X(X)\implies Y\sim U(0,1)

FY(y)P(Yy)=P(FX(X)y)=P(FX1(FX(X))FX1(y))=P(FX1(FX(X))XFX1(y),XFX1(y))+P(FX1(FX(X))XFX1(y),X>FX1(y))=P(XFX1(y))+0=FX(FX1(y))=yF is conti.\begin{align*} F_Y(y)&\triangleq P(Y\le y)\\ &=P(F_X(X)\le y)\\ &=P(F_X^{-1}(F_X(X))\le F_X^{-1}(y))\\ &=P(\underbrace{F_X^{-1}(F_X(X))}_{\le X}\le F_X^{-1}(y), X\le F_X^{-1}(y))+P(\underbrace{F_X^{-1}(F_X(X))}_{\le X}\le F_X^{-1}(y), X> F_X^{-1}(y))\\ &=P(X\le F_X^{-1}(y))+0\\ &=F_X(F_X^{-1}(y))=y \quad\because F \text{ is conti.} \end{align*}

Remark: UU(0,1)    1UU(0,1)U\sim U(0,1)\implies 1-U\sim U(0,1)

2lnUχ22    2ln(1U)χ22-2\ln U\sim \chi^2_2\implies -2\ln(1-U)\sim \chi^2_2

i.e. F\forall F 是連續的 cdf

2lnF(X)χ222ln(1F(X))χ22-2\ln F(X)\sim \chi^2_2\qquad -2\ln(1-F(X))\sim \chi^2_2

多變量變換

Theorem

Let XX be a k-dim r.v. with conti. pdf fX(x)f_X(x) and Y=h(X)=(Y1,,Yk)t=(h1(X),,hk(X))tY=h(X)=(Y_1,\cdots,Y_k)^t=\left(h_1(X),\cdots,h_k(X)\right)^t

Suppose h:X11Yh:\mathscr{X}\xrightarrow{1-1}\mathscr{Y} with X={x:fX(x)>0}\mathscr{X}=\set{x:f_X(x)>0} and Y=h(X)\mathscr{Y}=h(\mathscr{X}) s.t. X=h1(y)=(g1(y),,gk(y))tX=h^{-1}(y)=\left(g_1(y),\cdots,g_k(y)\right)^t exists and yigj(y)\frac{\partial}{\partial y_i}g_j(y) exist and conti. i,j\forall i,j

Then the pdf of YY is

fY(y)=fY(y1,,yk)=fX(h1(y))Jwhere J=det[g1y1g1ykgky1gkyk]k×kf_Y(y)=f_Y(y1,\cdots,y_k)=f_X(h^{-1}(y))|J| \quad\text{where } J=\det\begin{bmatrix} \frac{\partial g_1}{\partial y_1} & \cdots & \frac{\partial g_1}{\partial y_k}\\ \vdots & \ddots & \vdots\\ \frac{\partial g_k}{\partial y_1} & \cdots & \frac{\partial g_k}{\partial y_k} \end{bmatrix}_{k\times k}

EX: X=(X1,X2,X3,X4)tfX(x1,x2,x3,x4)=24ex1x2x3x4X=(X_1,X_2,X_3,X_4)^t\sim f_X(x_1,x_2,x_3,x_4)=24e^{-x_1-x_2-x_3-x_4} with 0<x1<x2<x3<x4<0<x_1<x_2<x_3<x_4<\infty, let

Y1=X1Y2=X2X1Y3=X3X2Y4=X4X3    X1=Y1X2=Y1+Y2X3=Y1+Y2+Y3X4=Y1+Y2+Y3+Y4\begin{align*} Y_1&=X_1\\ Y_2&=X_2-X_1\\ Y_3&=X_3-X_2\\ Y_4&=X_4-X_3 \end{align*}\implies \begin{align*} X_1&=Y_1\\ X_2&=Y_1+Y_2\\ X_3&=Y_1+Y_2+Y_3\\ X_4&=Y_1+Y_2+Y_3+Y_4 \end{align*} J=det[1000110011101111]=10J=\det\begin{bmatrix} 1 & 0 & 0 & 0\\ 1 & 1 & 0 & 0\\ 1 & 1 & 1 & 0\\ 1 & 1 & 1 & 1 \end{bmatrix}=1\neq 0 fY(y1,y2,y3,y4)=fX(y1,y1+y2,y1+y2+y3,y1+y2+y3+y4)J=4e4y13e3y22e2y3ey4\begin{align*} f_Y(y_1,y_2,y_3,y_4)&=f_X(y_1,y_1+y_2,y_1+y_2+y_3,y_1+y_2+y_3+y_4)|J|\\ &=4e^{-4y_1}3e^{-3y_2}2e^{-2y_3}e^{-y_4} \end{align*} fY1=4e4y1,y1>0Y1Gamma(1,14)fY2=3e3y2,y2>0Y2Gamma(1,13)fY3=2e2y3,y3>0Y3Gamma(1,12)fY4=ey4,y4>0Y4Gamma(1,1)\begin{align*} f_{Y_1}&=4e^{-4y_1}, &y_1>0\quad &Y_1\sim\text{Gamma}(1,\frac{1}{4})\\ f_{Y_2}&=3e^{-3y_2}, &y_2>0\quad &Y_2\sim\text{Gamma}(1,\frac{1}{3})\\ f_{Y_3}&=2e^{-2y_3}, &y_3>0\quad &Y_3\sim\text{Gamma}(1,\frac{1}{2})\\ f_{Y_4}&=e^{-y_4}, &y_4>0\quad &Y_4\sim\text{Gamma}(1,1) \end{align*}

and Y1,Y2,Y3,Y4Y_1,Y_2,Y_3,Y_4 are independent

EX: Given XGamma(α1,β),YGamma(α2,β)X\sim\text{Gamma}(\alpha_1,\beta), Y\sim\text{Gamma}(\alpha_2,\beta) and XY    fX,Y(x,y)=fX(x)fY(y)X\perp Y\iff f_{X,Y}(x,y)=f_X(x)f_Y(y)

Let T=X+Y,W=XX+Y    X=TW,Y=TTWT=X+Y, W=\frac{X}{X+Y}\implies X=TW, Y=T-TW

J=det[WT1WT]=TW(1W)T=TJ=\det\begin{bmatrix} W & T\\ 1-W & -T \end{bmatrix}=-TW-(1-W)T=-T fT,W(t,w)=fX,Y(tw,ttw)J=fX(tw)fY(ttw)t =1Γ(α1)βα1(tw)α11etw/β1Γ(α2)βα2(ttw)α21e(ttw)/βt=1Γ(α1+α2)βα1+α2tα1+α21et/βΓ(α1+α2)Γ(α1)Γ(α2)wα11(1w)α21\begin{align*} f_{T,W}(t,w)&=f_{X,Y}(tw,t-tw)|J|\\ &=f_X(tw)f_Y(t-tw)t\\\ &=\frac{1}{\Gamma(\alpha_1)\beta^{\alpha_1}}(tw)^{\alpha_1-1}e^{-tw/\beta}\cdot\frac{1}{\Gamma(\alpha_2)\beta^{\alpha_2}}(t-tw)^{\alpha_2-1}e^{-(t-tw)/\beta}\cdot t\\ &=\frac{1}{\Gamma(\alpha_1+\alpha_2)\beta^{\alpha_1+\alpha_2}}t^{\alpha_1+\alpha_2-1}e^{-t/\beta}\cdot\frac{\Gamma(\alpha_1+\alpha_2)}{\Gamma(\alpha_1)\Gamma(\alpha_2)}w^{\alpha_1-1}(1-w)^{\alpha_2-1} \end{align*}

    TW\implies T\perp W and TGamma(α1+α2,β),WBeta(α1,α2)T\sim\text{Gamma}(\alpha_1+\alpha_2,\beta), W\sim\text{Beta}(\alpha_1,\alpha_2)

i.e.

<XGamma(α1,β)YGamma(α2,β)    <X+YGamma(α1+α2,β)XX+YBeta(α1,α2)\perp\bigg<\begin{align*} X&\sim\text{Gamma}(\alpha_1,\beta)\\ Y&\sim\text{Gamma}(\alpha_2,\beta)\\ \end{align*}\implies\perp\bigg< \begin{align*} X+Y&\sim\text{Gamma}(\alpha_1+\alpha_2,\beta)\\ \frac{X}{X+Y}&\sim\text{Beta}(\alpha_1,\alpha_2) \end{align*}

XiGamma(αi,β),u=1,,kX_i\sim \text{Gamma}(\alpha_i,\beta),u=1,\cdots,k indep.

    i=1kXiGamma(i=1kαi,β),l<ki=1lXii=1kXiBeta(i=1lαi,i=1kαi)\implies\sum_{i=1}^k X_i\sim\text{Gamma}(\sum_{i=1}^k\alpha_i,\beta),\qquad l<k \quad\frac{\sum_{i=1}^l X_i}{\sum_{i=1}^k X_i}\sim\text{Beta}(\sum_{i=1}^l\alpha_i,\sum_{i=1}^k\alpha_i)

Remark X1,,XniidX_1,\cdots,X_n\overset{\text{iid}}{\sim} conti cdf F    F(Xi)iidU(0,1)F\implies F(X_i)\overset{\text{iid}}{\sim} U(0,1)

    2lni=1nF(Xi)=2i=1nlnF(Xi)χ2n2\implies -2\ln\prod_{i=1}^n F(X_i)=-2\sum_{i=1}^n\ln F(X_i)\sim\chi^2_{2n}

Remark:

  1. Z1,,ZniidN(0,1)    i=1nZi2χn2Z_1,\cdots,Z_n\overset{\text{iid}}{\sim}N(0,1)\implies\sum_{i=1}^nZ^2_i\sim\chi^2_n

        XiN(μi,σi2)\implies X_i\sim N(\mu_i,\sigma^2_i) indep.     i=1n(Xiμiσi)2χn2\implies\sum_{i=1}^n\left(\frac{X_i-\mu_i}{\sigma_i}\right)^2\sim\chi^2_n

  2. ZN(0,1)Xχm2Z\sim N(0,1)\perp X\sim\chi^2_m

    Let T=ZX/m,W=Xm    fT,W(t,w)dw=TT=\frac{Z}{\sqrt{X/m}},W=\sqrt{\frac{X}{m}}\implies \int f_{T,W}(t,w)dw=T 's pdf

    i.e N(0,1)/χm2/mtm    tm2=(N(0,1)2)χm2/m=χ12/1χm2/m=F1,mN(0,1)/\sqrt{\chi^2_m/m}\sim t_m\implies t_m^2=\frac{(N(0,1)^2)}{\chi^2_m/m}=\frac{\chi^2_1/1}{\chi^2_m/m}=F_{1,m}


EX: X,YiidU(α,β)X,Y\overset{\text{iid}}{\sim} U(\alpha,\beta),求 X+YX+Y 的分佈

    T=X+Y\implies T=X+Y, let W=XW=X

X=WY=TW    J=det[0111]=1\begin{align*} X&=W\\ Y&=T-W \end{align*}\implies J=\det\begin{bmatrix} 0 & 1\\ 1 & -1 \end{bmatrix}=-1     fT,W(t,w)=fX(w)fY(tw)=1(βα)2\implies f_{T,W}(t,w)=f_X(w)f_Y(t-w)=\frac{1}{(\beta-\alpha)^2} α<w<βα<tw<β    α<w<βtβ<w<tα    max{α,tβ}<w<min{β,tα}\begin{align*} \alpha<w<\beta\\ \alpha<t-w<\beta \end{align*}\iff\begin{align*} \alpha<w<\beta\\ t-\beta<w<t-\alpha \end{align*}\iff\begin{align*} \max\set{\alpha,t-\beta}<w<\min\set{\beta,t-\alpha} \end{align*}     fT(t)fT,W(t,w)dw=max{α,tβ}min{β,tα}1(βα)2dw=(min{β,tα}max{α,tβ})(βα)2={1(βα)2(t2α)2αt<α+β1(βα)2(2βt)α+βt<2β\begin{align*} \implies f_T(t)&\triangleq\int_{-\infty}^\infty f_{T,W}(t,w)dw\\ &=\int_{\max\set{\alpha,t-\beta}}^{\min\set{\beta,t-\alpha}}\frac{1}{(\beta-\alpha)^2}dw\\ &=\frac{\left(\min\set{\beta,t-\alpha}-\max\set{\alpha,t-\beta}\right)}{(\beta-\alpha)^2}\\ &=\begin{cases} \frac{1}{(\beta-\alpha)^2}(t-2\alpha) & 2\alpha\le t< \alpha+\beta\\ \frac{1}{(\beta-\alpha)^2}(2\beta-t) & \alpha+\beta\le t< 2\beta \end{cases} \end{align*}

EX: XP(λ)YP(θ)X\sim P(\lambda)\perp Y\sim P(\theta),求 X+YX+Y 的分佈

Let T=X+YT=X+Y

fT(t)=P(X+Y=t)=xP(X=x,Y=tx)=x=0teθθtx(tx)!eλλxx!=e(λ+θ)1t!x=0tt!(tx)!x!λxθtxBinomial theorem=e(λ+θ)(λ+θ)tt!\begin{align*} f_T(t)&=P(X+Y=t)\\ &=\sum_x P(X=x,Y=t-x)\\ &=\sum_{x=0}^t \frac{e^{-\theta}\theta^{t-x}}{(t-x)!}\cdot\frac{e^{-\lambda}\lambda^x}{x!}\\ &=e^{-(\lambda+\theta)}\cdot\frac{1}{t!}\underbrace{\sum_{x=0}^t\frac{t!}{(t-x)!x!}\lambda^x\theta^{t-x}}_{\text{Binomial theorem}}\\ &=\frac{e^{-(\lambda+\theta)}(\lambda+\theta)^t}{t!} \end{align*}

i.e. XiP(λi)X_i\sim P(\lambda_i) indep.     XiP(λi)\implies \sum X_i\sim P(\sum\lambda_i)