Docsity

Midterm 2 Exam in Computing in Statistics: Jackknife Estimation and Standard Deviation - P, Exams of Statistics

Toggle sidebar
bg1
Name: ________________________________________
22S:166 Computing in Statistics
Instructor: Cowles
Midterm 2
Nov 6-7, 2007
Instructions: You may use Windows R, or if you prefer, you may log into a Linux
computer and run Linux R. Copy and paste your solutions into this Word document.
Submit your midterm by uploading it into ICON.
1. The sd function in R computes the sample standard deviation of a vector of
numbers. Write a function to do the following:
a. accept a vector of numbers
b. compute the sample standard deviation
c. obtain jackknife estimates of bias and standard error
d. return the original estimate, the bias-corrected estimate, and the standard error
Generate a random sample of size 20 from a Gamma density with parameters
shape=10 and rate=1, and use it as input to your jackknife function. Paste the
code for your function, the call to the function, and the output here.
2. Is the sample standard deviation a biased estimator, and does jackknife bias
correction make the bias better or worse? Carry out a simulation study to find
out for the case when the population distribution is Gamma with parameters
shape=10 and rate=1. Note that the following line of R code calculates the true
standard deviation of a Gamma density with parameters shape=alpha and
rate=beta.
truesd <- sqrt( alpha / beta^2)
Write an R program to carry out a simulation study as follows. Simulate S
replicate datasets of size n=20 from a Gamma(10,1) density. For each replicate
dataset, calculate the sample standard deviation and the jackknife bias-corrected
estimate.
Test and debug your code with S set small (5 or10). Do your final run with
S=1000. Summarize the results in a table that shows: the true population
standard deviation, the mean of the original statistic across datasets and the mean
of the jackknife bias-corrected estimates across datasets.
Paste your R code and the output from the final run here.
pf2

Partial preview of the text

Download Midterm 2 Exam in Computing in Statistics: Jackknife Estimation and Standard Deviation - P and more Exams Statistics in PDF only on Docsity!

Name: ________________________________________ 22S:166 Computing in Statistics Instructor: Cowles Midterm 2 Nov 6-7, 2007 Instructions: You may use Windows R, or if you prefer, you may log into a Linux computer and run Linux R. Copy and paste your solutions into this Word document. Submit your midterm by uploading it into ICON.

  1. The sd function in R computes the sample standard deviation of a vector of numbers. Write a function to do the following: a. accept a vector of numbers b. compute the sample standard deviation c. obtain jackknife estimates of bias and standard error d. return the original estimate, the bias-corrected estimate, and the standard error Generate a random sample of size 20 from a Gamma density with parameters shape=10 and rate=1, and use it as input to your jackknife function. Paste the code for your function, the call to the function, and the output here.
  2. Is the sample standard deviation a biased estimator, and does jackknife bias correction make the bias better or worse? Carry out a simulation study to find out for the case when the population distribution is Gamma with parameters shape=10 and rate=1. Note that the following line of R code calculates the true standard deviation of a Gamma density with parameters shape=alpha and rate=beta. truesd <- sqrt( alpha / beta^2) Write an R program to carry out a simulation study as follows. Simulate S replicate datasets of size n=20 from a Gamma(10,1) density. For each replicate dataset, calculate the sample standard deviation and the jackknife bias-corrected estimate. Test and debug your code with S set small (5 or10). Do your final run with S=1000. Summarize the results in a table that shows: the true population standard deviation, the mean of the original statistic across datasets and the mean of the jackknife bias-corrected estimates across datasets. Paste your R code and the output from the final run here.

Write a couple of sentences interpreting the results with respect to bias in the original statistic and how well the jackknife bias-correction works.

  1. A publisher of textbooks would like an efficient storage structure for information on its textbooks and their authors. Note that a textbook may have more than one author, and a single author may write more than one textbook. The variables that the publisher would like to store are: a. ISBN number (a unique identifier for a book) b. Author name c. author address d. author phone number e. author email f. author birth year g. Book title h. Book list price i. Book year of publication Identify a set of relational tables that could store these data items in first, second, and third normal form. For each table, indicate the primary key and any foreign keys. You may type your answer into the Word document you submit, or you may simply hand write it on this paper.