Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Test the gamma pseudo-random number generator on your computer. Simulate 10,000 gamma pseudo-random variables with parameters a and 1 for \(a = 0.5,1,1.5,2,5,\) 10. Then draw gamma quantile plots

Short Answer

Expert verified

Generate using \(R\) with \(gamma(n,\) shape \( = 10,\) rate \(1),\) use the code for \(Q - Q\) plots.

Step by step solution

01

Pseudo-random generator

The procedures widely used to produce random values are not random. When random variables are produced by a predetermined method but pass the predefined test statistic for random chance, they are called pseudo-random numbers. The series of counts produced by a system is entirely calculated by the method's data input (or the initial pseudo-random).

02

To draw gamma quantile plots.

RStudio can use the built-in functions Gamma (n, Shape = 10, Rate = 1) to generate a random sample of size n = 10000 from the gamma distribution. Here, the shape is represented by. It depends on the alpha of the exercise. Then plot the Q - Q plot using the following code.

From the numbers below for the various parameter choices, we can see that the theoretical and sample quantiles generate reasonably straight lines. The sample is taken from the gamma distribution except for the points above. For, the variance of the gamma distribution is expected.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Suppose that \({x_1},...,{x_n}\) from a random sample from an exponential distribution with parameter\(\theta \).Explain how to use the parametric bootstrap to estimate the variance of the sample average\(\overline X \).(No simulation is required.)

In Example 12.6.7, let \(\left( {{X^*},{Y^*}} \right)\) be a random draw from the sample distribution\({F_n}\) . Prove that the correlation \({X^*} and {Y^*}\) is R in Eq. (12.6.2).

Let X and Y be independent random variables with \(X\) having the t distribution with five degrees of freedom and Y having the t distribution with three degrees of freedom. We are interested in \(E\left( {|X - Y|} \right).\)

a. Simulate 1000 pairs of \(\left( {{X_i},{Y_i}} \right)\) each with the above joint distribution and estimate \(E\left( {|X - Y|} \right).\)

b. Use your 1000 simulated pairs to estimate the variance of \(|X - Y|\) also.

c. Based on your estimated variance, how many simulations would you need to be 99 percent confident that your estimator is within the actual mean?

Consider, once again, the model described in Example \({\bf{7}}{\bf{.5}}{\bf{.10}}{\bf{.}}\) Assume that \({\bf{n = 10}}\) the observed values of \({{\bf{X}}_{\bf{1}}},...,{{\bf{X}}_{{\bf{1}}0}}\) are

\( - 0.92,\,\, - 0.33,\,\, - 0.09,\,\,\,0.27,\,\,\,0.50, - 0.60,\,1.66,\, - 1.86,\,\,\,3.29,\,\,\,2.30\).

a. Fit the model to the observed data using the Gibbs sampling algorithm developed in Exercise. Use the following prior hyperparameters: \({{\bf{\alpha }}_{\bf{0}}}{\bf{ = 1,}}{{\bf{\beta }}_{\bf{0}}}{\bf{ = 1,}}{{\bf{\mu }}_{\bf{0}}}{\bf{ = 0}}\,{\bf{and}}\,{\bf{ }}{{\bf{\lambda }}_{\bf{0}}}{\bf{ = 1}}\)

b. For each i, estimate the posterior probability that \({\rm{ }}{{\rm{x}}_i}\)came for the normal distribution with unknown mean and variance.

Use the blood pressure data in Table 9.2 that was described in Exercise 10 of Sec. 9.6. Suppose now that we are not confident that the variances are the same for the two treatment groups. Perform a parametric bootstrap analysis of the sort done in Example 12.6.10. Use v=10,000 bootstrap simulations.

a. Estimate the probability of type I error for a two-sample t-test whose nominal level is \({\alpha _0} = 0.1.\)

b. Correct the level of the two-sample t-test by computing the appropriate quantile of the bootstrap distribution of \(\left| {{U^{(i)}}} \right|.\)

c. Compute the standard simulation error for the quantile in part (b).

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free