Skip to contents

FFSCB p-value (Gaussian)

Usage

get_pvalue_FFSCB_z(x, x0 = NULL, tau, diag.cov, eval.points = NULL, n_int = 5)

Arguments

x

Functional parameter estimate (for instance, the empirical mean function).

x0

Functional parameter under the null hypothesis. Default: zero.

tau

Pointwise standard deviation of the standardized and differentiated sample functions. Can be estimated by tau_fun().

diag.cov

The diagonal of Cov(x), in which x is the functional estimator. For instance, the diagonal of the discretized covariance function of the empirical mean function x.

eval.points

Evaluation points (in [0,1]) at which the pvalues should be computed.

n_int

Number of intervals parameter used by the function make_band_FFSCB_z()

References

Liebl, D. and Reimherr, M. (2022+). Fast and fair simultaneous confidence bands.

Examples

# Generate a sample
p <- 200 
N <- 80 
grid   <- make_grid(p, rangevals=c(0,1))
mu0    <- meanf_poly(grid,c(0,1))   ; names(mu0) <- grid
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
hat.tau    <- tau_fun(sample)

# pvalue
pval <- get_pvalue_FFSCB_z(x=hat.mu, x0=mu0, tau=hat.tau, 
                           diag.cov=diag(hat.cov.mu), 
                           eval.points=c(.25,.75))
pval
#> [1] 0.9999339 0.7253329