STAT 400

Mon. March 2nd, 2020


(Continuous) Cumulative Distribution Function

The cumulative distribution function for a continuous random variable XX with pdf f(x)f(x) is F(x)=P(Xx)=xf(y)dy.F(x)=P(X\le x)=\int_{-\infin}^x f(y)dy.

Ex. XX follows unif(A,B)\text{unif}(A,B). Find the cdf of XX.f(x)={1BAx[A,B]0otherwiseF(x)={0xAxf(y)dy=Axf(y)dy=XABAAXBxf(y)dy=ABf(y)dy=1xB\begin{aligned} f(x)&=\begin{cases} \frac{1}{B-A} & x\in[A,B]\\ 0 & \text{otherwise} \end{cases}\\\\ F(x)&=\begin{cases} 0 & x\le A\\ \int_{-\infin}^x f(y)dy=\int_A^x f(y)dy=\frac{X-A}{B-A} & A\le X\le B\\ \int_{-\infin}^x f(y)dy=\int_A^B f(y)dy = 1 & x\ge B \end{cases} \end{aligned}


Properties

  1. F(x)F(x) is the total area under f(y)f(y) to the left of xx.
  2. Since f(y)0f(y)\ge 0, we know F(x)F(x) is non-decreasing.
  3. 0F(x)10\le F(x)\le 1.

Proposition. Given the pdf f(x)f(x) and the cdf F(x)F(x) of a continuous RV XX, then: P(X>a)=1P(Xa)=1F(a)P(aXb)=P(Xb)P(Xa)=F(b)F(a)\begin{aligned} &P(X>a)=1-P(X\le a)=1-F(a)\\ &P(a\le X\le b)=P(X\le b)-P(X\le a)=F(b)-F(a)\\ \end{aligned} Remember that since we’re dealing with continuous functions now, the edge cases of X=aX=a and X=bX=b don’t affect the cdf like they do for discrete variables.

Proposition. From the fundamental theorem of calculus, we have f(x)=ddxF(x).f(x)=\frac{d}{dx}F(x). Thus you can calculate a pdf given a cdf and vice-versa.


Percentiles of a Continuous Distribution

In some cases we want to solve the inverse problem of finding the cdf F(x)F(x) – that is, given pp, we want to find aa such that P(Xa)=F(a)=pP(X\le a)=F(a)=p.

Definition. Given 0p10\le p\le 1, the (100p)(100p)th percentile of XX, denoted as η(p)\eta(p), satisfies p=F(η(p))=η(p)f(x)dx.p=F(\eta(p))=\int_{-\infin}^{\eta(p)}f(x)dx.


Ex. The pdf of XX is f(x)={18+38x0x20otherwisef(x)=\begin{cases} \frac{1}{8}+\frac{3}{8}x & 0\le x\le 2\\ 0 &\text{otherwise} \end{cases} and its cdf is F(X)={0x0x8+316x20x21x>2F(X)=\begin{cases} 0&x\le 0\\ \frac{x}{8}+\frac{3}{16}x^2&0\le x\le 2\\ 1&x>2 \end{cases}

Given p=116p=\frac{1}{16} find η(p)\eta(p). F(η(p))=116η(p)8+316η(p)2=116η(p)=1 or 13η(p)=13.\begin{aligned} F(\eta(p))&=\frac{1}{16}\\ \frac{\eta(p)}{8}+\frac{3}{16}\eta(p)^2&=\frac{1}{16}\\ \eta(p)&=-1\text{ or }\frac{1}{3}\\ \eta(p)&=\frac{1}{3}. \end{aligned}


Median

Definition. For p=0.5p=0.5, we call η(0.5)\eta(0.5) the median, denoted by μ~\tilde{\mu}. By definition, F(μ~)=0.5F(\tilde{\mu})=0.5.

Remark. μ=μ~\mu=\tilde{\mu} when the pdf being studied is symmetric; i.e. f(μ~+x)=f(μ~x)f(\tilde{\mu}+x)=f(\tilde{\mu}-x) for all xx.
For instance, if XX follows unif(A,B)\text{unif}(A,B), μ~=μ=A+B2.\tilde{\mu}=\mu=\frac{A+B}{2}.


Expected Value

Definition. The expected value of a continuous random variable XX with pdf f(x)f(x) is μ=μX=E(X)=xf(x)dx.\mu=\mu_X=E(X)=\int_{-\infin}^{\infin}xf(x)dx.

Ex. XX follows unif(A,B)\text{unif}(A,B). E(X)=ABx1BAdx=1BAB2A22=(B+A)(BA)2(BA)=B+A2.\begin{aligned} E(X)&=\int_A^Bx\cdot \frac{1}{B-A}dx\\ &=\frac{1}{B-A}\cdot \frac{B^2-A^2}{2}\\ &=\frac{(B+A)(B-A)}{2(B-A)}\\ &=\frac{B+A}{2}. \end{aligned} This result is in line with our remark about the median of random variables with symmetric pdfs.


Proposition. If XX is a continuous RV with pdf f(x)f(x), then the expected value of h(X)h(X) is μh(X)=E(h(X))=h(x)f(x)dx.\mu_{h(X)}=E(h(X))=\int_{-\infin}^{\infin}h(x)f(x)dx.

Ex. XX follows unif(A,B)\text{unif}(A,B). Find E(X2)E(X^2).
E(X2)=x2f(x)dx=ABx21BAdx=1BAB3A33B3A3=(BA)(B2+BA+A2)E(X2)=13(B2+BA+A2).\begin{aligned} E(X^2)&=\int_{-\infin}^{\infin}x^2f(x)dx\\ &=\int_A^Bx^2\cdot\frac{1}{B-A}dx\\ &=\frac{1}{B-A}\cdot \frac{B^3-A^3}{3}\\ B^3-A^3&=(B-A)(B^2+BA+A^2)\\ \rightarrow E(X^2)&=\frac{1}{3}(B^2+BA+A^2). \end{aligned}


Variance and Standard Deviation

Definition. The variance of a continuous random variable XX with pdf f(x)f(x) and expected value μ\mu is σX2=V(X)=(xμ)2f(x)dx=E((Xμ)2).\sigma_X^2=V(X)=\int_{-\infin}^{\infin}(x-\mu)^2f(x)dx=E((X-\mu)^2).
The standard deviation (SD) of XX is σX=V(X)\sigma_X=\sqrt{V(X)}.

Proposition. V(X)=E(X2)[E(X)]2V(X)=E(X^2)-[E(X)]^2, exactly the same property as with discrete RVs.

Ex. XX follows unif(A,B)\text{unif}(A,B). V(X)=13(B2+BA+A2)(B+A2)2=112(AB)2.V(X)=\frac{1}{3}(B^2+BA+A^2)-(\frac{B+A}{2})^2=\frac{1}{12}(A-B)^2.