Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Probability-Statistics-Jupy…
GitHub Repository: Probability-Statistics-Jupyter-Notebook/probability-statistics-notebook
Path: blob/master/notebook-for-learning/Chapter-7-Statistical-Estimation-and-Sampling-Distributions.ipynb
388 views
Kernel: Python 3
''' Import here useful libraries Run this cell first for convenience ''' import numpy as np from scipy import stats import scipy import warnings warnings.simplefilter('ignore', DeprecationWarning)

Chapter 7 - Statistical Estimation and Sampling Distributions

Point estimates

Parameters

  • Parameters: term used in statistical inference for a quantity θ\theta determining the shape of an unknown probabiity distribution

    • Goal: estimate the unknown parameters to obtain the distribution

Statistics

  • Statistic: function of a random sample (e.g. sample mean, variance, quantile...)

  • Statistics are random variables whose observed values can be calculated from a set of observed data

Estimation

  • Estimation: procedure of "guessing" properties of the population from which data are collected

  • Point estimate: statistic θ^\hat{\theta} representing a "best guess" of the real θ\theta value

Properties of Point Estimates

Unbiased Estimates

  • Unbiased point estimate: a θ^\hat{\theta} for a parameter θ\theta satisfying: E(θ^)=θ\begin{equation} E(\hat{\theta}) = \theta \end{equation}

  • Bias definition: bias(θ^)=E(θ^)θ\begin{equation} bias(\hat{\theta}) = E(\hat{\theta})-\theta \end{equation}

  • Point estimate of a population mean: given a random sample X1,,XnX_1, \cdots, X_n from a distribution with mean μ\mu, the sample mean Xˉ\bar{X} is an unbiased estimate of μ\mu

  • Point estimate of a population variance: given a random sample X1,,XnX_1, \cdots, X_n from a distribution with variance σ2\sigma ^2, the sample variance S2S ^2 is an unbiased estimate of σ2\sigma ^2

Minimum Variance Estimates

  • Minimum variance unbiased estimate: unbiased point estimate whose variance is smaller than any other unbiased point estimate

Relative efficiency

  • Relative efficiency: of an unbiased point estimate θ^1\hat{\theta}_1 to another θ^2\hat{\theta}_2 Var(θ^2)Var(θ^1)\begin{equation} \frac{Var(\hat{\theta}_2)}{Var(\hat{\theta}_1)} \end{equation}

Mean squared error (MSE)

MSE(θ^)=E(θ^θ)2\begin{equation} MSE(\hat{\theta}) = E( \hat{\theta} - \theta) ^2 \end{equation}
  • Alternative form: MSE(θ^)=Var(θ^)+bias2(θ^)\begin{equation} MSE(\hat{\theta}) = Var( \hat{\theta}) + bias^2 (\hat{ \theta }) \end{equation}

Sample Proportion

Sample Proportion

  • If XB(n,p)X \sim B(n,p) then the sample proportion p^=Xn\hat{p} = \frac{X}{n} has approximately the distribution N(p,p(1p)n)N(p, \frac{p(1-p)}{n})

  • Standard error of p^\hat{p}: s.e.(p^)=p(1p)n\begin{equation} s.e.(\hat{p}) = \sqrt{ \frac {p(1-p)}{n}} \end{equation} When nn is large, then s.e.(p^)s.e.(\hat{p}) is approximated by p^(1p^)n\sqrt{ \frac{ \hat{p} (1 - \hat{p} )}{n}}.

Sample Mean

  • Distribution of sample mean: given X1,,XnX_1, \cdots, X_n a random sample from a distribution with mean μ\mu and variance σ2\sigma ^2, the centra limit theorem says: XˉN(μ,σ2n) for large n\begin{equation} \bar{X} \sim N \left( \mu, \frac{\sigma^2}{n} \right) \text{ for large } n \end{equation}

  • Standard error of the sample mean: s.e.(Xˉ)=σns.e.(\bar{X}) = \frac{\sigma}{\sqrt{n}}

  • When σ\sigma is unknown and nn is large, then the standard error is approximated by sn\frac{s}{\sqrt{n}}

Sample Variance

  • Distribution of sample variance: given X1,,XnX_1, \cdots, X_n a random sample from N(μ,σ2)N( \mu, \sigma^2), then: (n1)S2σ2χn12\begin{equation} \frac{(n-1) S^2}{\sigma^2} \sim \chi _{n-1}^2 \end{equation}

  • t-statistics: given X1,,XnX_1, \cdots, X_n a random sample from N(μ,σ2)N( \mu, \sigma^2), then T=n(Xˉμ)Stn1\begin{equation} T = \frac{\sqrt{n}( \bar{X} - \mu) }{S} \sim t_{n-1} \end{equation}

Constructing Parameter Estimates

The Methods of Moments

  • Method of Moments point estimate (MME) for one parameter: given a data set of observations x1,,xnx_1, \cdots, x_n from a probability distribution depending on one parameter θ\theta, then the MME(θ^)ofθ(\hat{\theta}) of \theta is found by solving the following equation xˉ=E(X)\begin{equation} \bar{x} = E(X) \end{equation}

  • Method of Moments point estimate (MME) for two parameters: the unknown parameters can be found as: xˉ=E(X)\begin{equation} \bar{x} = E(X) \end{equation} and s2=Var(X)\begin{equation} s^2 = Var(X) \end{equation}

Maximum Likelihood Estimates

  • Maximum likelihood estimate for one parameter: given a data set of observations x1,,xnx_1, \cdots, x_n from a probability distribution f(x;θ)f(x; \theta) then MLE(θ^)=maxθL(θ)=maxθf(x1;θ)××f(xm;θ)\begin{equation} \text{MLE}(\hat{\theta}) = \max_{\theta}L(\theta) = \max_{\theta} f(x_1; \theta) \times \cdots \times f(x_m; \theta) \end{equation} where L(θ)L(\theta) is the likelihood function

  • Maximum likelihood estimate for two parameters: θ1\theta_1 and θ2\theta_2 are the values of the parameters at which the likelihood function is maximized

MLE for U(0,Θ)U(0, \Theta)

  • For some distribution, the MLE may not be found by differentiation and we should look at the curve of the likelihood function itself

  • MLE of θ=max{X1,,Xn}\theta = \max \{ X_1, \cdots, X_n \}