Lecture 12: Discrete vs. Continuous, the Uniform

피망이·2023년 12월 6일
0
post-thumbnail

Intoduction

DiscreteContinuous
XXXX
PMF $P(X=x)PDF fx(x)f_x(x) [P(X=x)=0P(X=x) = 0]
CDF Fx(x)=P(Xx)F_x(x) = P(X \le x)CDF Fx(x)=P(Xx)F_x(x) = P(X \le x)
E(X)=xP(X=x)E(X) = \displaystyle \sum_{x} P(X=x)E(X)=sfx(x)dxE(X) = \int_{-∞}^{∞} sf_x(x) dx
V(X)=E(X2)(EX)2V(X) = E(X^2) - (EX)^2V(X)=E(X2)(EX)2V(X) = E(X^2) - (EX)^2
sd(X)=Var(X)sd(X) = \sqrt{Var(X)}sd(X)=Var(X)sd(X) = \sqrt{Var(X)}
LOTUS E(g(X))=xg(x)P(X=x)E(g(X)) = \displaystyle \sum_x g(x) P(X=x)LOTUS E(g(X))=xg(x)P(X=x)E(g(X)) = \displaystyle \sum_x g(x) P(X=x)

PDF (probability density function)

  • Defn

    • R.V XX has PDF f(x)f(x) if P(aXb)=abf(x)dxP(a \le X \le b) = \int_{a}^{b} f(x)dx

    • For all a, b [a=baaf(x)dx=0a=b \Rightarrow \int_{a}^{a} f(x)dx = 0]

      • To be valid, f(x)0f(x) \ge 0, f(x)dx=1\int_{-∞}^{∞} f(x)dx = 1
    • f(x0)    ϵP(X(x0ϵ2,x0+ϵ2)f(x_0)\; • \; \epsilon \approx P(X \in (x_0 - \displaystyle \frac{\epsilon}{2}, x_0 + \displaystyle \frac{\epsilon}{2}) for ϵ>0\epsilon > 0 very small.

      • This is the density

  • If XX has PDF f, the CDF is F(x)=P(Xx)=xf(t)dtF(x) = P(X \le x) = \int_{-∞}^{x} f(t)dt (tt is the dummy variable, not conflict with xx)

  • If XX has CDF, F(and X is continuous), then

    • f(x)=F(x)f(x) = F'(x) by FTC(Fundamental Theorom of Calculus). <derivative>
  • P(a<X<b)=abf(x)dx=F(b)F(a)P(a < X < b) = \int_{a}^{b} f(x) dx = F(b) - F(a) by FTC

Variance

  • Var(X)=E(XEX)2Var(X) = E(X-EX)^2

    • Variance가 절댓값 형태가 아닌 이유는 다루기 복잡해서다 (미분 불가 때문).
  • Standard deviation : SD(X)=Var(X)SD(X) = \sqrt{Var(X)}

  • Another way to express Var :

    • Var(X)=E(X22X(EX)+(EX)2)Var(X) = E(X^2 - 2X(EX) + (EX)^2)

      =E(X2)2E(X)EX+(EX)2=E(X2)(EX)2= E(X^2) - 2E(X)EX + (EX)^2 = E(X^2) - (EX)^2

    • Notation : EX2=E(X2)EX^2 = E(X^2)

Unif(a, b)

  • Completely "random point in [a, b]"

  • Unif : prob. \propto length.

    • 중심을 기준으로 대칭 → 길이에 따라 확률이 커짐!
  • PDF

    • f(x)={c,if  axb0,otherwise1=abcdx=c(ba),  c=1baf(x) = \begin{cases} c, & {if \; a \le x \le b} \\ 0, & {otherwise} \end{cases} \Rightarrow 1 = \int_{a}^{b} cdx = c(b-a), \; c = \displaystyle \frac{1}{b-a}
  • CDF

    • F(X)=xf(t)dt=abf(t)dt={0,if  x<axaba,ifaxb1,if  x>bF(X) = \int_{-∞}^{x} f(t) dt = \int_{a}^{b} f(t) dt = \begin{cases} 0, & {if \; x < a} \\ \displaystyle \frac{x-a}{b-a}, & {if a \le x \le b} \\ 1, & {if \; x > b} \end{cases}
  • Expective

    • E(X)=ab=xbadx=x22(ba)ab=12(ba)(ba)(b+a)E(X) = \int_{a}^{b} = \displaystyle \frac{x}{b-a} dx = \displaystyle\frac{x^2}{2(b-a)} \biggr|_{a}^{b} = \frac{1}{2(b-a)} (b-a)(b+a)

      =(a+b)/2= (a+b) / 2

    • Expectation is mid point! (intuitive answer)

  • Variance

    • If Y=X2Y=X^2, E(X2)=E(Y)E(X^2) = E(Y) need PDF of Y?

      • x2fx(x)dx\int_{-\infty}^{\infty} x^2 f_x(x) dx
    • Law of the unconscious statistician(무의식 통계학자의 법칙) (LOTUS)

      • E(g(X))=g(x)fx(x)dxE(g(X)) = \int_{-\infty}^{\infty} g(x) f_x(x) dx
    • Let UUnif(0,1)U \sim Unif(0, 1), E(U)=1/2E(U) = 1/2, E(U2)=01U2fu(u)duE(U^2) = \int_{0}^{1} U^2 f_u(u) du

      • fu(u)duf_u(u) du is constant, E(U2)=01U2    1=1/3E(U^2) = \int_{0}^{1} U^2 \; • \; 1 = 1/3

      • Var(U)=E(U2)(EU)2=1/31/4=1/12Var(U) = E(U^2) - (EU)^2 = 1/3 - 1/4 = 1/12

Uniform is universal

  • Uniform을 통해 모든 확률 분포를 알 수 있다.

    • Let UUnif(0,1)U \sim Unif(0, 1), FF be a CDF(assume F is strictly increasing continous <F는 연속인 증가함수>)
  • Theorm

    • Let X=F1(U)X = F^{-1}(U), Then XFX \sim F
  • Proof

    • P(Xx)=P(F1(U)x)=P(F(F1(U))F(x))P(UF(x))P(X \le x) = P(F^{-1}(U) \le x) = P(F(F^{-1}(U)) \le F(x)) P(U \le F(x))

      =P(UF(x))=F(X)= P(U \le F(x)) = F(X)

      • Unif(0, 1)에서 x까지의 확률은 간격의 길이임!


profile
물리학 전공자의 프로그래밍 도전기

0개의 댓글