# Goodness of Fit

This is a statistical test that determines how well sample data fits a distribution (from a population with a normal distribution <- that part I am not sure).

It hypothesizes whether a sample is skewed or represents the data you would expect to find in the actual population.

We combine the goodness of fit test with Hypothesis Testing to come to the conclusion about whether a sample data fits the distribution.

Theorem $Λ=2∑Y_{j}lnE_{j}Y_{j} ∼χ_{2}(k−1−p)$ i.e. $λ=2∑y_{j}lne_{j}y_{j} ∼χ_{2}(k−1−p)$ where

- $k=#of categories$
- $p=#parameters estimated underH_{0}$
- $y_{i}=observed frequency$
- $e_{i}=expected frequency underH_{0}$

Notice that if $y_{i}=e_{i}$ for all $i$, then $λ=0$.

For example if you are rolling a 6 sided die and trying to assess if this die is fair. Then you would have $k=6$ (since each side is one category). $p$ is 0.

And where does this fit with MLE?

Hypothesis Testing $H_{0}$: The data fits our distribution $H_{1}$: The data does not fit our distribution

#todo Show example with Poisson Distribution, see page 384.