

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
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.