Some key concepts explained

By Afshine Amidi and Shervine Amidi

Use a distribution table to compute a probability

Let XN(μ,σ)X\sim\mathcal{N}(\mu,\sigma) with μ,σ\mu, \sigma known and a,bRa,b\in\mathbb{R}.

Question: Compute P(aXb)P(a\leqslant X\leqslant b).



Step 1 ― Standardize XX

We introduce ZZ, such that

Z=XμσN(0,1)Z=\frac{X-\mu}{\sigma}\sim\mathcal{N}(0,1)


Step 2 ― Express the probability in terms of ZZ

We have:

P(aXb)=P(aμσXμσZbμσ)=P(Zbμσ)P(Zaμσ)P(a\leqslant X\leqslant b)=P\bigg(\frac{a-\mu}{\sigma}\leqslant\underbrace{\frac{X-\mu}{\sigma}}_{Z}\leqslant\frac{b-\mu}{\sigma}\bigg)=P\left(Z\leqslant \frac{b-\mu}{\sigma}\right)-P\left(Z\leqslant\frac{a-\mu}{\sigma}\right)


Step 3 ― Find each term using the distribution table

Given that the values of aμσ\frac{a-\mu}{\sigma} and bμσ\frac{b-\mu}{\sigma} are known, we just have to look them up in a distribution table similar to this one.



Summing up We just computed the value of the probability by standardizing the normal variable to be able to look up the values in a standard normal distribution table.



Confidence intervals

Compute the confidence interval for μ\mu

Note: the example below is specific to the case where the variance is known and nn is large. The following reasoning can be reproduced for other cases in a similar fashion.

Let X1,...,XnX_1, ..., X_n be a random sample with mean μ\mu and standard deviation σ\sigma where only σ\sigma is known, and let α[0,1]\alpha\in[0,1].

Question: Compute a confidence interval on μ\mu with confidence level 1α1-\alpha, that we note CI1αCI_{1-\alpha}.



Step 1 ― Write in mathematical terms what we are seaching for

We want to find a confidence interval CI1αCI_{1-\alpha} of confidence level 1α1-\alpha for μ\mu:

P(μCI1α)=1αP(\mu\in CI_{1-\alpha})=1-\alpha


Step 2 ― Consider the sample mean of XX

We consider X\overline{X}, which is such that:

X=1ni=1nXi\overline{X}=\frac{1}{n}\sum_{i=1}^nX_i


Step 3 ― Standardize X\overline{X}

We introduce ZZ, such that:

Z=Xμσnn1N(0,1)Z=\frac{\overline{X}-\mu}{\frac{\sigma}{\sqrt{n}}}\underset{n\gg1}{\sim}\mathcal{N}(0,1)

In general, this relationship is valid for large nn but it is always true in the particular case when the XiX_i are normal.



Step 4 ― Use ZZ to find the quantiles

We can find the quantiles of ZZ which are such that:

P(zα2Zzα2)=1αP(-z_{\frac{\alpha}{2}}\leqslant Z\leqslant z_{\frac{\alpha}{2}})=1-\alpha

Given that ZZ follows a standard normal distribution, the quantity zα2z_{\frac{\alpha}{2}} can be found in the distribution table.



Step 5 ― Re-write ZZ in terms of X\overline{X}

Knowing that Z=XμσnZ=\frac{\overline{X}-\mu}{\frac{\sigma}{\sqrt{n}}}, we can re-write the previous expression:

P(Xzα2σnμX+zα2σn)=1αP\left(\overline{X}-z_{\frac{\alpha}{2}}\frac{\sigma}{\sqrt{n}}\leqslant \mu\leqslant \overline{X}+z_{\frac{\alpha}{2}}\frac{\sigma}{\sqrt{n}}\right)=1-\alpha


Step 6 ― Deduce the confidence interval

By taking into account steps 1 and 5, we can now deduce the confidence interval for μ\mu:

CI1α=[Xzα2σn,X+zα2σn]\boxed{CI_{1-\alpha}=\left[\overline{X}-z_{\frac{\alpha}{2}}\frac{\sigma}{\sqrt{n}},\overline{X}+z_{\frac{\alpha}{2}}\frac{\sigma}{\sqrt{n}}\right]}



Compute the confidence interval for σ2\sigma^2

Let X1,...,XnX_1, ..., X_n be a random sample with mean μ\mu and standard deviation σ\sigma where σ\sigma is unknown, and let α[0,1]\alpha\in[0,1].

Question: Compute a confidence interval on σ2\sigma^2 with confidence level 1α1-\alpha, that we note CI1αCI_{1-\alpha}.



Step 1 ― Write in mathematical terms what we are seaching for

We want to find a confidence interval CI1αCI_{1-\alpha} of confidence level 1α1-\alpha for σ2\sigma^2:

P(σ2CI1α)=1αP(\sigma^2\in CI_{1-\alpha})=1-\alpha


Step 2 ― Consider the sample variance of XX

We consider s2s^2, which is such that:

s2=1n1i=1n(XiX)2s^2=\frac{1}{n-1}\sum_{i=1}^n(X_i-\overline{X})^2


Step 3 ― Standardize s2s^2

We introduce KK, such that:

K=s2(n1)σ2χn12K=\frac{s^2(n-1)}{\sigma^2}\sim\chi_{n-1}^2

Here, KK follows a χ2\chi^2 distribution with n1n-1 degrees of freedom.



Step 4 ― Use KK to find the quantiles

We can find the quantiles χ12,χ22\chi_1^2, \chi_2^2 of KK which are such that:

P(χ12Kχ22)=1αP(\chi_1^2\leqslant K\leqslant \chi_2^2)=1-\alpha

Given that KK follows a χ2\chi^2 distribution with n1n-1 degrees of freedom, the quantiles can be found in the distribution table.



Step 5 ― Re-write KK in terms of s2s^2

Knowing that K=s2(n1)σ2K=\frac{s^2(n-1)}{\sigma^2}, we can re-write the previous expression:

P(s2(n1)χ22σ2s2(n1)χ12)=1αP\left(\frac{s^2(n-1)}{\chi_2^2}\leqslant \sigma^2\leqslant\frac{s^2(n-1)}{\chi_1^2}\right)=1-\alpha


Step 6 ― Deduce the confidence interval

By taking into account steps 1 and 5, we can now deduce the confidence interval for σ2\sigma^2:

CI1α=[s2(n1)χ22,s2(n1)χ12]\boxed{CI_{1-\alpha}=\left[\frac{s^2(n-1)}{\chi_2^2},\frac{s^2(n-1)}{\chi_1^2}\right]}