Background. The traditional way to get a 95% CI for the population standard deviation of a normal distribution (with mean unknown) is to pivot the the quantity
$\frac{(n-1)S^2}{\sigma^2} \sim\mathsf{Chisq}(\nu=n-1)$ to obtain the 95% CI for $\sigma^2$ of the form
$\left(\frac{(n-1)S^2}{U},\frac{(n-1)S^2}{L}\right),$ where $L$ and $U$ cut probability $0.025$ from the lower and upper tails, respectively, of $\mathsf{Chisq}(n-1).$
to get a 95% CI for $\sigma^2.$ And then take square roots of endpoints to get a 95% CI for $\sigma.$
Thus if $X_1, \dots, X_{20}$ is a random sample from $\mathsf{Norm}(\mu=50,\sigma=7),$ which has $S^2 = 7.62,$ then we can find a 95% CI $(6.37,9.50)$ for $\sigma,$ as follows.
[Sampling and computation in R.]
set.seed(2021)
x = rnorm(20, 50, 7)
s = sd(x); s
[1] 7.621391
sqrt(49*s^2/qchisq(c(.975,.025), 49))
[1] 6.366407 9.497269
Simple quantile bootstrap. Now suppose we had
the vector x
without knowing the distribution
from which it was sampled, and want to get a 95% nonparametric bootstrap CI for $\sigma$ using a
simple quantile method based on sample standard deviations.
We get the CI $(4.90,9.43).$ It contains $\sigma=7$
(near the center), but it is longer than the CI
that uses normal distribution theory. The increased
length is not surprising because we have (and use)
less information about the source of the data.
set.seed(201)
s = replicate(2000, sd(sample(x,20,rep=T)))
quantile(s, c(.025, .975))
2.5% 97.5%
4.898676 9.431256
There are many methods of nonparametric bootstrapping for CIs
that might have been used, some of them arguably better, but the quantile bootstrap above is one
of the simpler methods.
Now suppose we have a random sample y
of size $n = 100$ with sample standard deviation $S = 1.063.$ We know only that it is from a continuous distribution for which the population standard deviation $\sigma$ exists.
summary(y); length(y); s=sd(y); s
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.4955 1.3131 1.8799 2.0798 2.5453 6.6592
[1] 100 # sample size
[1] 1.063716 # sample sd.
A 95% nonparametric bootstrap CI using the simple quantile method is $(0.82,1.30).$ [Because I
simulated y
from the distribution $\mathsf{Beta}(\mathrm{shape}=4,\mathsf{rate}=2),$ I know that
the population $\sigma=1.$ As far as I know, there is
no really simple parametric CI for $\sigma.]$
set.seed(121)
sd = replicate(2000, sd(sample(y,100,rep=T)))
quantile(sd, c(.025, .975))
2.5% 97.5%
0.8221678 1.3001359
Pivotal Bootstrap. A somewhat different kind of CI for $\sigma$ might be
to say that if I knew the distribution theory I could find $L$ and $U$ such that $P(L < S - \sigma < U)= 0.95,$ I could pivot to get a 95% CI of the form
$(S-U, S-L)$ for $\sigma.$
Not knowing, the distribution theory I use bootstrapping to estimate
$L$ and $U$ by $L^*$ and $U^*,$ respectively, temporarily using the observed $S_{obs}$ as a proxy
for unknown $\sigma.$
In the R code, I use the
suffix .re
to denote re-sampled quantities. In the
last step s.obs
returns to its role as the observed
sample SD. This style of bootstrap CI gives
the interval $(0.84, 1.29),$ which is not much different numerically from the simple quantile bootstrap CI above. However, for markedly
skewed distributions, the pivotal method may have advantages.
set.seed(1234)
s.obs = sd(y)
d.re = replicate(2000, sd(sample(y,100,rep=T))-s.obs)
UL = quantile(d.re, c(.975,.025))
s.obs - UL
97.5% 2.5%
0.8444399 1.2913911
Note: Sample y
was simulated in R as follows:
set.seed(1234)
y = rgamma(100, 4, 2)
sd(y)
[1] 1.063716