R code homework

Problem 1. This is about computing bootstrap confidence intervals. 
A. Write a function sd.bootCI(x, level = 0.95, B = 2000) that returns a bootstrap pivotal confidence interval for the standard deviation based on a sample, a specified level, and a given number of bootstrap replicates. 
B. Write a function sd.bootCI.student(x, level = 0.95, B = 2000) that returns a bootstrap Studentized pivotal confidence interval for the standard deviation. You have (at least) two avenues for estimating for the standard deviation of the sample standard deviation. Choose the first one if you can, otherwise choose the other (which is more computationally demanding): (a) Derive a closed form expression for the standard deviation of the sample standard deviation and then use a plug in to obtain an estimate. (No need to show how you derived it. In fact, you can search for that in books or online.) (b) Estimate the standard deviation of the sample standard deviation by bootstrap.
 C. Perform some simulations to compare the two methods (pivotal and Studentized pivotal). For example, you can generate a sample of size n ∈ {10, 20, 50, 100, 200} from the exponential distribution with rate 1, compute the intervals, see if they include the true standard deviation and record their length, and repeat that N = 200 times, and present a summary of these experiments. 

Problem 2. Consider the geyser dataset in the MASS package. Focus on the variable duration. 
A. Use your function from Problem 1 to build a 90% confidence interval for the standard deviation of the duration of Old Faithful Geyser’s eruptions. 
B. Do the same, but using the functions boot and boot.ci in the package boot. (Note that this may not be an iid sample of eruptions, since there might be dependencies over time, but we ignore this in this exercise.) 

Problem 3. Consider the geyser dataset in the MASS package. Focus on the variable waiting. Waiting times are often modeled as exponentially distributed. Apply the Lilliefors test for that purpose. The exponential family is a scale family, and so the Lilliefors approach is appropriate. You can use the package KScorrect or implement it yourself as lilliefors.exponential.test(x, M = 2000).

Place your order
(550 words)

Approximate price: $22

Homework help cost calculator

600 words
We'll send you the complete homework by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 customer support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • 4 hour deadline
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 300 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
× How can I help you?