Learn R Programming

OLCPM (version 0.1.1)

test.once.flat: test single change point for matrix-valued online time series -''flat'' version

Description

This function tests single change point for matrix-valued online time series, under a two-way factor structure, using ''flat'' sample covariance matrix.

Usage

test.once.flat(
  Y,
  k = 1,
  m = 20,
  epsilon = 0.05,
  r = 8,
  decrease = 0,
  method = "ps",
  eta = 0.25,
  cv = 2.386
)

Value

a list containing:

test

a logical value. 1 indicating the existence of change point, 0 indicating no change point.

loc

an integer larger than m, indicating the location of change point; or \(NA\) when no change point is reported.

Arguments

Y

data, a \(T\times p1\times p2\) array.

k

a positive integer indicating which eigenvalue to monitor. \(k=1\) for the largest eigenvalue.

m

a positive integer (\(>1\)) indicating the bandwidth of the rolling windom.

epsilon

the rescaling parameter taking value in \((0,1)\); see He et al. (2021).

r

a positive integer indicating the order of the transformation function \(g(x)=|x|^r\); see also gen.psi.tau.proj.

decrease

a logical value. If decrease=1, testing the decrease of factor number.

method

indicating the test statistic, ``ps'' for the partial-sum method; others for the worst-case method.

eta

a number between \([0,1)\), indicating the parameter \(\eta\) used in the partial-sum statistic.

cv

critical value; see also test.once.psi.

Author

Yong He, Xinbing Kong, Lorenzo Trapani, Long Yu

Details

See He et al. (2021).

References

He Y, Kong X, Trapani L, & Yu L(2021). Online change-point detection for matrix-valued time series with latent two-way factor structure. arXiv preprint, arXiv:2112.13479.

Examples

Run this code

k1=3
k2=3
epsilon=0.05
Sample_T=50
p1=40
p2=20
r=8
m=p2

# generate data
Y=gen.data(Sample_T,p1,p2,k1,k2,tau=0.5,change=1,pp=0.5)

# calculate cv for "ps" with eta=0.45 and "wc"
cv1=getcv(0.05,method="ps",eta=0.45)
cv2=getcv(0.05,method="wc")


## test with Y, flat version
test.once.flat(Y,k1+1,m,epsilon,r,0,method="ps",eta=0.25)


test.once.flat(Y,k1+1,m,epsilon,r,0,method="ps",eta=0.45,cv1)


test.once.flat(Y,k1+1,m,epsilon,r,0,method="wc",eta=0.5,cv2)

Run the code above in your browser using DataLab