Learn R Programming

nsp (version 1.0.0)

cov_dep_multi_norm_poly: Simulate covariate-dependent multiscale sup-norm for use in NSP, for piecewise-polynomial models

Description

This function simulates the multiscale sup-norm adjusted for the form of the covariates, as described in Section 5.3 of the paper, for piecewise-polynomial models of degree deg. This is done for i.i.d. N(0,1) innovations.

Usage

cov_dep_multi_norm_poly(n, deg, N = 10000)

Arguments

n

The data length (for which the multiscale norm is to be simulated)

deg

The degree of the polynomial model (0 for the piecewise-constant model; 1 for piecewise-linearity, etc.).

N

Desired number of simulated values of the norm.

Value

Sample of size N containing the simulated norms.

Details

The NSP algorithm is described in P. Fryzlewicz (2021) "Narrowest Significance Pursuit: inference for multiple change-points in linear models", preprint.

See Also

cov_dep_multi_norm, sim_max_holder

Examples

Run this code
# NOT RUN {
set.seed(1)
g <- c(rep(0, 100), rep(2, 100))
x.g <- g + stats::rnorm(200)
mscale.norm.200 <- cov_dep_multi_norm_poly(200, 0, 100)
nsp_poly(x.g, 100, thresh.val = stats::quantile(mscale.norm.200, .95))
# }

Run the code above in your browser using DataLab