permutationTest: Permutation Test for Subspace Method

Description Usage Arguments Details Value References See Also Examples

View source: R/permutationTest.R

Description

Calculates a threshold for the Subspace Method via a permutation test as described in \insertCiteGrundy2020;textualchangepoint.cov

Usage

1
permutationTest(X, subspaceDim, msl = dim(X)[2], alpha = 0.05, nperm = 200)

Arguments

X

Data matrix of dimension n by p.

subspaceDim

Dimension of the latent subspace.

msl

Minimum segment length between changepoints. Note this should be greater than or equal to p

alpha

Significance level of test

nperm

Number of random permutations to be performed

Details

This function works by generating the specified number of permutations of the original data set and running the Subspace method on each permutation in order to get samples from the distribution of the test statistic.

Value

Numeric containing the threshold value

References

\insertRef

Grundy2020changepoint.cov

See Also

cptSubspace

Examples

1
2
3
4
set.seed(1)
data <- subspaceDataGeneration(n=100,p=20,subspaceDim=5,tau=50)$data
ans <- permutationTest(X=data,subspaceDim=5,msl=20,nperm=100)
ans

grundy95/changepoint.cov documentation built on April 5, 2021, 6:21 p.m.