Write a program in (mathrm{R}) that simulates 1000 sequences of independent random variables of length (n) where

Question:

Write a program in \(\mathrm{R}\) that simulates 1000 sequences of independent random variables of length \(n\) where the \(k^{\text {th }}\) variable in the sequence has an \(\operatorname{Exponential}\left(\theta_{k}ight)\) distribution where \(\theta_{k}=k^{-1 / 2}\) for all \(k \in \mathbb{N}\). For each simulated sequence, compute \(Z_{n}=n^{1 / 2} \tau_{n}^{-1}\left(\bar{X}_{n}-\bar{\mu}_{n}ight)\), where

\[\tau_{k}^{2}=\sum_{i=1}^{k} k^{-1}\]

Plot the 1000 values of \(Z_{n}\) on a density histogram and overlay the histogram with a plot of a \(\mathrm{N}(0,1)\) density. Repeat the experiment for \(n=5,10,25\), 100 and 500 and describe how the distribution converges.

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: