University of Minnesota, Twin Cities School of Statistics Stat 8701 Rweb
The policy is the same as the policy for Homework No. 2.
This assignment is due (initially) Friday, April 19, 2002.
Another course I taught fall semester covered the bootstrap. It had web pages with some examples that may (or may not) be helpful (I'll leave that to you do decide). The web pages relevant to the material involved in this assignment are
TIntervals
BetterBootstrap Confidence Intervals
The ts
library in R contains a times series treering
(on-line
help). It can be view with the following code
library(ts) data(treering) plot(treering)Suppose I want to fit an AR(4) model to this series. For those who don't know, that is a model of the form
errorsencountered in statistics). The following code fits the model
library(ts) data(treering) ar(treering, aic = FALSE, order.max = 4)(if you try without the optional arguments you will see that it uses AIC to choose which AR(k) model it fits and that it choses a different model from the one I did, but that is the subject for another homework).
Assume this time series is stationary and that the estimators of the AR coefficients obey the square root law and determine conficence intervals for the AR coefficients using the subsampling bootstrap with subsample size 100 (if everybody uses 100 our results will all agree).
The file
contains 200 observations from a gamma distribution. The problem is to estimate the shape parameter using the method of moments estimatordata <- read.table(url("http://www.stat.umn.edu/geyer/5601/mydata/gamma.txt"), header = TRUE) attach(data) hist(x) alpha.hat <- mean(x)^2 / var(x) print(alpha.hat)
The asymptotic variance of this estimator is
2 * alpha * (1 + alpha) / n
where alpha
is
the true unknown parameter value.
The variance stabilizing transformation for alpha.hat
and its inverse are given by the following
varstab <- function(alpha) sqrt(2) * asinh(sqrt(alpha)) varstabinv <- function(beta) sinh(beta / sqrt(2))^2The random variable
varstab(alpha.hat)
is asymptotically
standard normal (mean varstab(alpha)
, variance one).
Calculate the following confidence intervals for the true unknown shape parameter
stupidbootstrap-t confidence interval that uses
sdfun <- function(x, nbootsd, theta, ...) return(1)for the standardization.
sdfun <- function(x, nbootsd, theta, ...) { alpha.hat <- mean(x)^2 / var(x) return(sqrt(2 * alpha.hat * (1 + alpha.hat))) }for the standardization.
sdfun
and uses the double bootstrap
to calculate one.
The default bootstrap and double bootstrap sample sizes in these functions
are too small, in keeping for
Efron and Tibshirani's general attitude. As explained on the
web page about bootstrap-t intervals for the other class.
Use nboott = 1000
and nbootsd = 200
or larger in your calculations. Otherwise the intervals will be so
random as to be ungradable.
Also use bootstrap sample sizes of 1000 or more when doing the percentile and BCa intervals.