Latihan simulasi kecil untuk menggambarkan apakah jawaban oleh @soakley berfungsi:
# Set the number of trials, M
M=10^6
# Set the true mean for each trial
mu=rep(0,M)
# Set the true standard deviation for each trial
sd=rep(1,M)
# Set counter to zero
count=0
for(i in 1:M){
# Control the random number generation so that the experiment is replicable
set.seed(i)
# Generate one draw of a normal random variable with a given mean and standard deviation
x=rnorm(n=1,mean=mu[i],sd=sd[i])
# Estimate the lower confidence bound for the population mean
lower=x-9.68*abs(x)
# Estimate the upper confidence bound for the population mean
upper=x+9.68*abs(x)
# If the true mean is within the confidence interval, count it in
if( (lower<mu[i]) && (mu[i]<upper) ) count=count+1
}
# Obtain the percentage of cases when the true mean is within the confidence interval
count_pct=count/M
# Print the result
print(count_pct)
[1] 1
Dari satu juta percobaan acak, interval kepercayaan mencakup rata-rata sejuta kali, yaitu selalu . Itu seharusnya tidak terjadi jika interval kepercayaan adalah interval kepercayaan 95% .
Jadi rumusnya sepertinya tidak berfungsi ... Atau sudahkah saya membuat kesalahan pengkodean?
(μ,σ)=(1000,1)
0.950097≈0.95(μ,σ)=(1000,1000)