Stat 511 HW7 sol S09

# Stat 511 HW7 sol S09 - STAT 511 HW#7 SPRING 2009 PROBLEM 1:

This preview shows pages 1–4. Sign up to view the full content.

STAT 511 HW#7 SPRING 2009 PROBLEM 1: bootstrap<-function(x,nboot,theta) { data<-matrix(sample(x,size=length(x)*nboot,replace=T),nrow=nboot) return(apply(data,1,theta)) } library(MASS) compound1<-c(3.03,5.53,5.60,9.30,9.92,12.51,12.95,15.21,16.04,16.84) compound2<-c(3.19,4.26,4.47,4.53,4.67,4.69,5.78,6.79,9.37,12.75) a) qqnorm(compound1) qqnorm(compound2) We do not expect “constant variance/normal distribution” ordinary statistical methods to be reliable in the analysis of these data because it seems compound 2 cannot be described with a normal distribution. qqnorm(log(compound1)) qqnorm(log(compound2))

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
It is still not appropriate to use “constant variance/normal distribution” ordinary statistical methods in the analysis of the log lifetimes. median(compound2) [1] 4.68 B <- 10000 comp2boot.non <- bootstrap(compound2,B,"median") round(sqrt(var(comp2boot.non)),3) [1] 0.825 # standard error for the sample median b) kl<-floor((B+1)*.025) ku<-B+1-kl sortcomp2boot.non<-sort(comp2boot.non) sortcomp2boot.non[kl] sortcomp2boot.non[ku] A 95% percentile bootstrap confidence interval for the median of F is (4.395,7.575) c) fit2 <- fitdistr(compound2,"weibull") fit2 shape scale 2.3201647 6.8595713 (0.5243747) (0.9957547) The ML estimates of the shape and scale parameters of a Weibull distribution are 2.32 and 6.86, respectively. Wboot<-function(samp,nboot,theta,shape,scale) { data<-scale*matrix(rweibull(samp*nboot,shape),nrow=nboot) return(apply(data,1,theta)) } comp2boot.Wei <- Wboot(10,B,"median",fit2\$estimate[1],fit2\$estimate[2]) round(sqrt(var(comp2boot.Wei)),3) [1] 1.085 sortcomp2boot.Wei <- sort(comp2boot.Wei) round(c(sortcomp2boot.Wei[kl],sortcomp2boot.Wei[ku]),3) [1] 3.865 8.134 A parametric bootstrap standard error for the sample median is 1.085 millions of cycles and a parametric 95% (unadjusted) percentile bootstrap confidence inteval for the median of F is (3.865, 8.134). The parametric standard
error is larger than the non-parametric standard error. Therefore, the parametric confidence interval is wider than the non-parametric confidence interval. d) 1/(2*dweibull(median(compound2),fit2\$estimate[1],fit2\$estimate[2])*sqrt(10)) [1] 1.169029 g G±(²)√³ = 1:169 is similar to the parametric bootstrap standard error. e)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/11/2012 for the course STAT 511 taught by Professor Staff during the Spring '08 term at Iowa State.

### Page1 / 9

Stat 511 HW7 sol S09 - STAT 511 HW#7 SPRING 2009 PROBLEM 1:

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online