Throughout, set \(R = 1001\) and use both \(N = 14\) and \(N = 258\) in separate runs.

Assume the population is Gamma, with \(\alpha, \beta > 0\) of your choice.

Pre-allocate an array of size \(R\).

In a for loop of length \(R\),

- generate \(N\) Gamma random variables. Use the function \(\texttt{numpy.random.gamma}(\alpha, \beta, N)\).
- estimate the population mean, using the array of random variables just generated. Store the estimate into the \(r\)th element of your pre-allocated array.

Estimate the population mean using the array of sample means.

Estimate the population standard deviation of the array of sample means.

Explain, in complete English sentences, what the standard deviation of the sample mean is telling us.

Make a plot density plot using the array of sample means.

Repeat steps a. through e. using the other sample size, overlaying the two density plots on each other. Use the color and label arguments of

`bp.density()`

to differentiate the two density curves on the same plot. Call`bp.legend()`

after your done plotting.Explain, in complete English sentences, why your two density curves look different.

- Assume the population is Binomial, with \(K\) an integer and \(p \in (0, 1)\) of your choice.
Pre-allocate an array of length \(R\).

In a for loop of size \(R\),

- generate \(N\) Binomial random variables. Use the function \(\texttt{numpy.random.binomial}(K, p, N)\).
- estimate the population standard deviation, using the array of random variables just generated. Store the estimate into the \(r\)th element of your pre-allocated array.

Estimate the population mean using the array of sample standard deviations.

Estimate the population standard deviation of the array of sample standard deviations.

Explain, in complete English sentences, what the standard deviation of the sample standard deviations is telling us.

Make a plot density plot using the array of sample standard deviations.

Repeat steps a. through e. using the other sample size, overlaying the two density plots on each other. Use the color and label arguments of

`bp.density()`

to differentiate the two density curves on the same plot. Call`bp.legend()`

after your done plotting.Explain, in complete English sentences, why your two density curves look different.

- Challenge. Assume the population is Normal, with \(\mu\) a real number and \(\sigma > 0\) of your choice.
Pre-allocate an array of size \(R\).

In a for loop of length \(R\),

- generate \(N\) Normal random variables. Use the function \(\texttt{numpy.random.normal}(\mu, \sigma, N)\).
- use Scipy’s function
`minimize`

to estimate the population mean, using the array of random variables just generated. Store the estimate into the \(r\)th element of your pre-allocated array.

Estimate the population mean using the array of sample means.

Estimate the population standard deviation of the array of sample means.

Explain, in complete English sentences, what the standard deviation of the sample means is telling us.

Make a plot density plot using the array of sample means.

Repeat steps a. through e. using the other sample size, overlaying the two density plots on each other. Use the color and label arguments of

`bp.density()`

to differentiate the two density curves on the same plot. Call`bp.legend()`

after your done plotting.Explain, in complete English sentences, why your two density curves look different.

- Double secret extra challenge. Assume the population is Normal, with \(\mu\) a real number and \(\sigma > 0\) of your choice.
Pre-allocate an array of size \((R, 2)\).

In a for loop of length \(R\),

- generate \(N\) Normal random variables. Use the function \(\texttt{numpy.random.normal}(\mu, \sigma, N)\).
- use Scipy’s function
`minimize`

to estimate the population mean and standard deviation, using the array of random variables just generated. Store the estimates into the \(r\)th row of your pre-allocated array.

Explain why your pre-allocated array needs dimensions \((R, 2)\). Try to use new statistical words.

Estimate the population mean of each column within your array of sample statistics. Hint: use the argument

`axis`

within the function`np.mean()`

. Some Googling/reading potentially required.Estimate the population standard deviation of each column within your array of sample statistics. Hint: use the argument

`axis`

within the function`np.std()`

. Some Googling/reading potentially required.Explain, in complete English sentences, what the standard deviation of each of the sample statistics is telling us.

Make an appropriate plot for each of the statistics. Give your plots titles with

`bp.title()`

and axis labels`bp.labels()`

to differentiate your plots.