### Critical value of 0.05 significant level
CV = PvarQuantile(n=1000, prob = 0.95)
CV
### The p-value of the same significant level.
1-PvarPvalue(n=1000, stat=CV)
### this may take for a wile:
x100 = replicate(2000, BBT(rnorm(100)), simplify=FALSE)
pvar100 = sapply(x100, pvar, p=4, info=FALSE)
# sample mean:
mean(pvar100)
# a mean according to Monte-Carlo simulation:
getMean(100)
# sample 0.95 quantile
quantile(pvar100, probs=0.95, type=8)
# a mean according to Monte-Carlo simulation:
PvarQuantile(n=100, prob = 0.95)
Run the code above in your browser using DataLab