Fast 'n' fair simultaneous confidence band (Gaussian)
make_band_FFSCB_z.Rd
Fast 'n' fair simultaneous confidence band (Gaussian)
Arguments
- x
Functional parameter estimate.
- diag.cov.x
Diagonal of Cov(x), in which x is the functional estimator (for instance, the covariance function of the empirical mean function).
- tau
Pointwise standard deviation of the standardized and differentiated sample functions. Can be estimated by tau_fun().
- conf.level
confidence level (default: 0.95)
- n_int
Number of equidistant intervals over which the multiple testing component of the type-I error rate (1-conf.level) is distributed uniformly.
Examples
# Generate a sample
p <- 200
N <- 80
grid <- make_grid(p, rangevals=c(0,1))
mu <- meanf_poly(grid,c(0,1.1))
names(mu) <- grid
cov.m <- make_cov_m(cov.f = covf_st_matern, grid=grid, cov.f.params=c(2/2,1,1))
sample <- make_sample(mu,cov.m,N)
# Compute the estimate and its covariance
hat.mu <- rowMeans(sample)
hat.cov <- crossprod(t(sample - hat.mu)) / N
hat.cov.mu <- hat.cov / N
# Compute the tau-parameter
hat.tau <- tau_fun(sample)
# Make and plot confidence bands
band <- make_band_FFSCB_z(x=hat.mu, diag.cov.x=diag(hat.cov.mu), tau=hat.tau,
conf.level = 0.95)
matplot(y=band[,2:3], x=grid, lty=2)
lines(x=grid, y=band[,1], lty=1)