Write a program in (mathrm{R}) that generates (b) samples of size (n) from a specified distribution (F).
Question:
Write a program in \(\mathrm{R}\) that generates \(b\) samples of size \(n\) from a specified distribution \(F\). For each sample compute the statistic \(Z_{n}=n^{1 / 2} \sigma^{-1}\left(\bar{X}_{n}-ight.\)
\(\mu\) ) where \(\mu\) and \(\sigma\) correspond to the mean and standard deviation of the specified distribution \(F\). Produce of histogram of the \(b\) observed values of \(Z_{n}\). Run this simulation for \(n=10,25,50\), and 100 with \(b=10,000\) for each of the distributions listed below and discuss how these histograms compare to what would be expected for large \(n\) as regulated by the underlying theory given by Theorem 4.20.
a. \(F\) corresponds to a \(\mathrm{N}(0,1)\) distribution.
b. \(F\) corresponds to an ExponEntial(1) distribution.
c. \(F\) corresponds to a \(\operatorname{Gamma}(2,2)\) distribution.
d. \(F\) corresponds to a \(\operatorname{UnIfORm}(0,1)\) distribution.
e. \(F\) corresponds to a \(\operatorname{BinOmial}\left(10, \frac{1}{2}ight)\) distribution.
f. \(F\) corresponds to a \(\operatorname{BinOmial}\left(10, \frac{1}{10}ight)\) distribution.
Step by Step Answer: