Suppose we observe an iid sample X_1, X-2, ..... X_in from Exp (1/theta) = (1/th
ID: 3206091 • Letter: S
Question
Suppose we observe an iid sample X_1, X-2, ..... X_in from Exp (1/theta) = (1/theta) exp (-x/theta). Compare the coverage probabilities (proportion of the intervals which contain (theta = 10) of the exact CI for theta. (2T/X^2_2n, alpha/2, 2T/x^2_2n, 1-alpha/2) with the approximate CI for theta: X bar plusminus z_alpha/2 (S/squreroot n), using Monte Carlo simulation, where z_alpha/2 is the upper alpha/2 quantile of a N(0, 1) distribution, x^2_2n, 1-alpha/2) and x^2_2n, alpha/2) are the lower and upper alpha/2 quantile of a X^2_2n distribution, T = sigma^n _i = 1 x_i, Generate B = 5,000iid sample X_1, X_2, ......, X_n, from Exp(10) = (1/10)exp(-x/10) with n = 10, 100, 1000. Use alpha = 0.05 and interpret your results.Explanation / Answer
## Sample sizes
N = c(10,100,1000)
## Coverage probabilities for each sample size.
CP = array(0, length(N))
for (k in 1:length(N))
{
n = N[k]
X = array(rexp(n*5000), c(5000,n))
## Construct the CI.
M = apply(X, 1, mean)
MX = apply(X, 1, max)
MN = apply(X, 1, min)
C = (MX - MN)/(2*sqrt(n))
## Determine which intervals cover EX=1.
ci = ((M-C < 1) & (M+C > 1))
## Calculate the proportion of intervals that cover.
CP[k] = mean(ci)
}
On running this code in R we get the required answers.
Results indicate coverage increases as sample size increases.