TD3: Goodness of Fit

Exercise 1

We want to test if a die is biased. it is rolled \(1000\) times, and the number of occurrences for each face is recorded. The data is as follows:

1 2 3 4 5 6
Counts 159 168 167 160 175 171
  1. Formulate the hypothesis testing problem
  2. Compute the expected counts under \(H_0\), give the degree of freedom \(d\) of the chi-squared test statistic and give the approximated p-value, using the cdf of \(\chi^2(d)\):

Exercise 2

In a survey of \(825\) families with \(3\) children, the number of boys was recorded:

\[ \begin{array}{|c|c|c|c|c|c|} \hline \text{Number of Boys} & 0 & 1 & 2 & 3 & \text{Total} \\ \hline \text{Number of Families} & 71 & 297 & 336 & 121 & 825 \\ \hline \end{array} \]

We assume under \(H_0\) that the genders of children in successive births within a family are independent categorical variables and that the probability \(p\) of having a boy remains constant.

  1. Determine the distribution of the number of boys in a family with 3 children as a function of \(p\).
  2. Estimate \(p\) using a maximum likelihood estimator.
  3. Test the goodness of fit to the distribution obtained in question 1.

Exercise 3

We observe X = [0, 1, 0, 0, 0, 0, 0, 0.5, 1, 1, 1, 0.7, 0.9, 1, 1, 1, 1, 0, 0.1, 0, 1] We assume that the entries of \(X\) are iid of distribution \(P\). We consider the following hypothesis testing problem:

\(H_0\): \(P= \mathcal B(0.5)\) (Bernoulli)\(\quad\) VS \(\quad\) \(H_1\): \(P \neq \mathcal B(0.5)\).

  1. What can you say about the assumptions, \(H_0\) and \(H_1\)?
  2. Draw on the same graph the CDF of a Bernoulli \(0.5\) and the empirical CDF of the observed data \(X\).
  3. Apply the Kolmogorov-Smirnov Test at level \(0.1\). To do so, use this table.
  4. Comment on the result.