Question: Write a program in (mathrm{R}) that simulates a sequence of independent and identically distributed random variables (B_{1}, ldots, B_{500}) where (B_{n}) is a (operatorname{BERNOuLLi}(theta)) random

Write a program in \(\mathrm{R}\) that simulates a sequence of independent and identically distributed random variables \(B_{1}, \ldots, B_{500}\) where \(B_{n}\) is a \(\operatorname{BERNOuLLi}(\theta)\) random variable where \(\theta\) is specified below. For each \(n=3, \ldots, 500\), compute

\[n^{1 / 2}\{\log [\log (n)]\}^{-1 / 2}\left(\bar{B}_{n}-\thetaight),\]

where \(\bar{B}_{n}\) is the sample mean computed on \(B_{1}, \ldots, B_{n}\). Repeat the experiment five times and plot each sequence

\[\left\{n^{1 / 2}\{\log [\log (n)]\}^{-1 / 2}\left(\bar{B}_{n}-\thetaight)ight\}_{n=3}^{500}\]

against \(n\) on the same set of axes. Describe the behavior observed for the sequence in each case in terms of the result of Example 5.3. Repeat the experiment for each \(\theta \in\{0.01,0.10,0.50,0.75\}\).

Step by Step Solution

3.27 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Introduction To Statistical Investigations Questions!