Displaying 1 result from an estimated 1 matches for "deltastar".
Did you mean:
deathstar
2017 Dec 07
1
Seeking help with code
...ential distribution
lambdahat = 1.0/mdr
lambdahat
#draw the bootstrap sample from Exponential
x = rexp(n*b, lambdahat)
x
bootstrapsample = matrix(x, nrow=n, ncol=b)
bootstrapsample
# Compute the bootstrap lambdastar
lambdastar = 1.0/colMeans(bootstrapsample)
lambdastar
# Compute the differences
deltastar = lambdastar - lambdahat
deltastar
# Find the 0.05 and 0.95 quantile for deltastar
d = quantile(deltastar, c(0.05,0.95))
d
# Calculate the 95% confidence interval for lambda.
ci = lambdahat - c(d[2], d[1])
ci
[[alternative HTML version deleted]]