Write a program in (mathrm{R}) that simulates samples of size (n=1, ldots, 100) from a distribution (F),
Question:
Write a program in \(\mathrm{R}\) that simulates samples of size \(n=1, \ldots, 100\) from a distribution \(F\), where \(F\) is specified below. For each sample compute the fourth sample central moment, as well as \(\tilde{\mu}_{1}\) and \(\tilde{\mu}_{4}\) where
\[\tilde{\mu}_{k}=n^{-1} \sum_{i=1}^{n}\left(X_{i}-\muight)^{k}\]
and \(X_{1}, \ldots, X_{n}\) denotes the simulated sample. For each value of \(n\), compute \(n^{1 / 2}\left(\hat{\mu}_{4}-\mu_{4}ight), n^{1 / 2}\left(\tilde{\mu}_{4}-\mu_{4}-4 \mu_{3} \tilde{\mu}_{1}ight)\), and the absolute difference between the two expressions. Repeat the experiment five times and plot the resulting sequences of differences against \(n\). Compare the limiting behavior of the absolute differences to what would be expected given the theory in Theorem 8.4, noting that the assumptions of the example are not met for all of the specified distributions given below.
a. \(\mathrm{N}(0,1)\)
b. \(\operatorname{Cauchy}(0,1)\)
c. \(\mathrm{T}(3)\)
d. Exponential(1)
Step by Step Answer: