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.

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.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern