/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q6E Use the data in Exercise 16 of S... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

Use the data in Exercise 16 of Sec. 10.7.

a. Use the nonparametric bootstrap to estimate the variance of the sample median.

b. How many bootstrap samples does it appear that you need to estimate the variance to within .005 with a probability of 0.95?

Short Answer

Expert verified

a. The estimate of the bias is equal to 19.446.

b. At least 3 million \(( \approx 2,988,027)\) bootstrap samples.

Step by step solution

01

(a) To find the bootstrap samples to estimate the variance to within .005 with a probability of 0.95

There are no assumptions for the distribution F, meaning the nonparametric bootstrap shall be used. The estimator of interest is the variance of the sample median.

To initialize the process, the sample median of the initial sample shall be computed. To find the bootstrap variance estimate, find the sample variances of the generated samples\({X^{*(i)}},i = 1,2, \ldots ,n\) from the distribution\(\hat F\). The bootstrap variance estimate is then the average of these values. The following code gives it in RStudio. Note that the variable of interest is Corn.

The sample median from the initial sample is equal to 24. The approximation of the variance, or the estimated variance, is 19.446. Note that this number will change every time you run the code. The number of samples used was \(n = 2000 = \nu .\)

02

(b) To find the bootstrap samples to estimate the variance to within .005 with a probability of 0.95

For the bias to be between -0.005 and 0.005 from the actual variance, one should look into the following probability

\(P ( - 0.005 < \theta < 0.005) = 0.95\)as in the exercise, the probability shall be at least 0.95. Then, one would need the estimator's expected value and standard deviation. Instead, take that the sample size is large and use the simulated sample standard deviation as an estimate (note here one should use the sample standard deviation of the n generated sample medians) and set the mean to be equal to zero. Then,

\(\begin{aligned}{l}P ( - 0.005 < \theta < 0.005) = P\left( {\frac{{ - 0.005 - 0}}{{\sqrt {4.1/n} }} < \frac{{\theta - 0}}{{\sqrt {4.1/n} }} < \frac{{0.005 - 0}}{{\sqrt {4.1/n} }}} \right)\\ \\ = P\left( {\frac{{ - 0.005 - 0}}{{\sqrt {4.1/n} }} < Z < \frac{{0.005 - 0}}{{\sqrt {4.1/n} }}} \right) \\\\ = 0.95,\quad \end{aligned}\)

or equally, because P(Z<1.96) =0.975 (standard normal is symmetric), it is true that

\(\frac{{0.005}}{{\sqrt {4.1/n} }} = 1.96\)

which leads to

\(n = {\left( {\frac{{4.1}}{{0.005}} \times 1.96} \right)^2} = 2,988,027\)

Instead of using the initial n=2000, use \(n \ge 2,988,027\) it to obtain the desired result. By rerunning the code with a changed value of n, the standard error of the simulation will be close to 0.0035<0.005. The estimate of the variance is close to 20.53.

#The library for built-in bootstrap functions

library(boot)

#Read data

Users

Important Thing

Desktop

Sladerwork

Statistics and Probability

Exercise6.txt",

# a column instead of a list

\(Corndata = matrix(unlist(data(1)))\)

# a way to find the sample median

\(OriginalSamplemedian = median\left( {CornData} \right)\)

# The number of bootstrap samples

n=2988027

xstarimedian = numeric (n)

Sample Bias = numeric (n)

\#generate sample \({x^ \wedge }i\) and the biases

for \((iin(1:n))\{ \)

#Generate the bootstrap sample with replacement

\(Xstar i = sample(CornData,Length(CornData)2 + 5,replace = T)\)

#Median of the bootstrap sample

\(Xstarimedian (i) = median(Xstari)\)}

#Average the differences

\(BootstrapEstimateVariance = var(XstariMedian)\)

#The second part

#The estimate of the standard deviation of the n sample medians

\(BootstrapEstimatesD = sd\left( {Xstarimedian} \right)\)

\(n = {( qnorm (0.975,0,1)* Bootstrap Estimate SD /0.005)^ \wedge }2\)

\(Bootstrap Estimate SD Median = sd (SampleBias)/sqrt (n)\)

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 91Ó°ÊÓ!

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

Use the beef hot dog data in Exercise 7 of Sec. 8.5. Form 10,000 nonparametric bootstrap samples to solve this exercise.

a. Approximate a 90 percent percentile bootstrap confidence interval for the median calorie count in beef hot dogs.

b. Approximate a 90 percent percentile-t bootstrap confidence interval for the median calorie count in beef hot dogs.

c. Compare these intervals to the 90 percent interval formed using the assumption that the data came from a normal distribution.

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).

If \({\bf{X}}\) has the Cauchy distribution, the mean \({\bf{X}}\)does not exist. What would you expect to happen if you simulated a large number of Cauchy random variables and computed their average?

Use the data in the Table \({\bf{11}}{\bf{.5}}\) on page \({\bf{699}}\) suppose that \({{\bf{y}}_{\bf{i}}}\) is the logarithm of pressure \({x_i}\)and is the boiling point for the I the observation \({\bf{i = 1,}}...{\bf{,17}}{\bf{.}}\) Use the robust regression scheme described in Exercise \({\bf{8}}\) to \({\bf{a = 5, b = 0}}{\bf{.1}}\,\,{\bf{and f = 0}}{\bf{.1}}{\bf{.}}\) Estimate the posterior means and standard deviations of the parameter \({{\bf{\beta }}_{\bf{0}}}{\bf{,}}{{\bf{\beta }}_{\bf{1}}}\,\) and n.

Describe how to convert a random sample \({{\bf{U}}_{\bf{1}}}{\bf{, \ldots ,}}{{\bf{U}}_{\bf{n}}}\) from the uniform distribution on the interval \({\bf{[0,1]}}\) to a random sample of size \({\bf{n}}\) from the uniform distribution on the interval\({\bf{[a,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.