

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An r function (my.jack) to calculate jackknife estimates of bias and standard error for the .75 quantile estimator of a population distribution. It also includes a simulation study (sim.jack) to test the unbiasedness of the jackknife estimate for a gamma(15, 0.5) distribution with a sample size of 20. The results show that the jackknife estimate is actually biased, as it overestimates the true quantile.
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!
My.Jack function(x) { n <- length(x) theta.hatn <- fivenum(x)[4] theta.hat <- rep(0,n) theta.wig <- rep(0,n) for(ii in 1:n) { theta.hat[ii] <- fivenum(x[-ii])[4] theta.wig[ii] <- n * theta.hatn - (n-1) * theta.hat[ii] } thetahat.dot <- mean(theta.hat) thetawig.dot <- mean(theta.wig) se.thetan <- sqrt(sum((theta.wig - thetawig.dot)^2) / (n * (n-1))) bias = (n-1) * (thetahat.dot - theta.hatn) unbiased <- n * theta.hatn - (n-1) * thetahat.dot list(Theta.hatn = theta.hatn, Theta.hat = theta.hat, Theta.wig = theta.wig, Std.Error = se.thetan, Bias = bias, Theta.Jack = thetawig.dot) }
My.Jack(rgamma(20,15,0.5)) $Theta.hatn [1] 37. $Theta.hat
$Theta.wig [1] 37.08957 37.08957 37.08957 37.08957 54.70705 37.08957 37.08957 54. [9] 37.08957 37.08957 54.70705 47.12894 37.08957 54.70705 37.08957 37. [17] 37.08957 37.08957 37.08957 54. $Std.Error [1] 1. $Bias [1] -4. $Theta.Jack [1] 41.
Sim.Jack function(B = 10) { jack.75 = rep(0,B) for(k in 1:B) { jack.75[k] = My.Jack(rgamma(20,15,0.5))$Theta.Jack } list(Real.Value = qgamma(0.75,15,0.5), Jack.Unbiased = mean(jack.75)) }
Sim.Jack(1000) $Real.Value [1] 34. $Jack.Unbiased [1] 41.