Write a program in (mathrm{R}) that simulates the sequence (left{X_{n}ight}_{n=1}^{100}) where (X_{n}) has a (operatorname{Geometric}left(theta_{n}ight)) distribution where
Question:
Write a program in \(\mathrm{R}\) that simulates the sequence \(\left\{X_{n}ight\}_{n=1}^{100}\) where \(X_{n}\) has a \(\operatorname{Geometric}\left(\theta_{n}ight)\) distribution where the sequence \(\theta_{n}\) is specified below. Repeat the experiment five times and plot the five realizations against \(n\) on the same set of axes. Describe the behavior of each sequence and compare this to the theoretical results of Exercise 7.
a. \(\theta_{n}=n(n+10)^{-1}\) for all \(n \in \mathbb{N}\).
b. \(\theta_{n}=n^{-1}\) for all \(n \in \mathbb{N}\).
c. \(\theta_{n}=n^{-2}\) for all \(n \in \mathbb{N}\).
d. \(\theta_{n}=\frac{1}{2}\) for all \(n \in \mathbb{N}\).
Exercise 7
Let \(\left\{X_{n}ight\}_{n=1}^{\infty}\) be a sequence of independent random variables where \(X_{n}\) has a \(\operatorname{GEOmetric}\left(\theta_{n}ight)\) distribution where \(\left\{\theta_{n}ight\}_{n=1}^{\infty}\) is described below. For each sequence determine whether \(X_{n}=O_{p}(1)\) as \(n ightarrow \infty\).
a. \(\theta_{n}=n(n+10)^{-1}\) for all \(n \in \mathbb{N}\).
b. \(\theta_{n}=n^{-1}\) for all \(n \in \mathbb{N}\).
c. \(\theta_{n}=n^{-2}\) for all \(n \in \mathbb{N}\).
d. \(\theta_{n}=\frac{1}{2}\) for all \(n \in \mathbb{N}\).
Step by Step Answer: