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

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

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

Generate \(N\) Gamma random variables. Use the function \(\texttt{numpy.random.gamma}(\alpha, \beta, N)\). Name this array

`X`

.- In a for loop of length \(R\),
- randomly choose elements of
`X`

with replacement, then estimate the population median with them. Store the estimate into the \(r\)th element of your pre-allocated array.

- randomly choose elements of
Estimate the population standard deviation of the sample median using your array of sample medians.

What is the name of this quantity?

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

Make a density plot using the array of sample medians.

What is the name of this density function?

Repeat steps a. through h. 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 sauce extra bonus 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)\).

Generate \(N\) Normal random variables. Use the function \(\texttt{numpy.random.normal}(\mu, \sigma, N)\). Name this array

`X`

.- In a for loop of length \(R\),
- create an array of randomly chosen integers from \(0\) to \(N - 1\), with replacement. Name this array
`idx`

. - use Scipy’s function
`minimize`

to estimate the population mean and standard deviation, using the array of random variables just generated. Instead of passing in`X`

, pass in`X`

indexed with`idx`

, as your data. Store the estimate into the \(r\)th element of your pre-allocated array.

- create an array of randomly chosen integers from \(0\) to \(N - 1\), with replacement. Name this array
Estimate the population standard deviation of the array of each sample statistic.

What is the name of these quantities? Hint: They can’t have the same name, they differ by what they are the standard deviation of.

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

Make a plot density plot using the array of each sample statistic.

What is the name of these density functions? Hint: They can’t have the same name, they differ by what they are the standard deviation of.

Repeat steps a. through h. using the other sample size for each sample statistic, 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.