Learn R Programming

factorcpt (version 0.1.2)

factor.seg.alg: Simultaneous multiple change-point and factor analysis for high-dimensional time series

Description

The function applies the two-stage methodology for multiple change-point detection under factor modelling. It first transforms the input time series into panels of statistics that contain the change-points in the second-order structure of the common and idiosyncratic components, as change-points in their `means', to which the Double CUSUM Binary Segmentation algorithm is applied in the second stage. The function returns change-point estimates from the common and idiosyncratic components separately.

Usage

factor.seg.alg(x, r=NULL, bn.op=2, sig.lev=.05, max.q=NULL, q.seq=NULL, qlen=5, qby=0, dw=NULL, p=NULL, B=200, scales=NULL, rule=NULL, mby=NULL, tby=NULL, idio.diag=FALSE, do.parallel=TRUE, no.proc=2)

Arguments

x
input time series matrix, with each row representing a time series
r
the number of factors, if r=NULL, screening over a range of factor number candidates is performed as described in the paper
bn.op
an index number for the information criterion-based estimator of Bai and Ng (2002) for the number of factors, the default value bn.op=2 is used in Barigozzi, Cho & Fryzlewicz (2016)
sig.lev
sets the level of significance for drawing the bootstrap-based threshold
max.q
the maximum number of factors, if max.q=NULL, a default value is chosen as described in the paper
q.seq
a vector of factor number candidates; if q.seq=NULL, it is chosen as described in Barigozzi, Cho & Fryzlewicz (2016) using qlen or qby
qlen
specifies the length of the sequence of factor number candidates
qby
specifies the increment of the sequence of factor number candidates when qlen=0; if both qlen=0 and qby=0, the sequence of factor number candidates is generated as if qby=1
dw
trims off the interval of consideration in the binary segmentation algorithm and determines the minimum length of a stationary segment; if dw=NULL, a default value is chosen as described in the Appendix of Barigozzi, Cho & Fryzlewicz (2016)
p
inverse of the average length of blocks in the stationary bootstrap procedure, if p=NULL, a data-driven value is chosen as described in the Appendix of Barigozzi, Cho & Fryzlewicz (2016)
B
the number of bootstrap samples for threshold selection
scales
the number of wavelet scales used for wavelet filtering of the common and idiosyncratic components estimated via PCA
rule
the depth of a binary tree for change-point analysis, see the Appendix of Barigozzi, Cho & Fryzlewicz (2016)
mby
see dmby in func_dc_by
tby
see dtby in func_dc_by
idio.diag
if idio.diag=TRUE, only the diagonal wavelet-transform is employed in order to generate the panel of statistics from the idiosyncratic components
do.parallel
if do.parallel=TRUE, a set of copies of R running in parallel are created and used for bootstrap procedure
no.proc
sets the number of processes to be spawned when do.parallel=TRUE,

Value

References

J. Bai and S. Ng (2002) Determining the number of factors in approximate factor models. Econometrica. 70: 191-221.

M. Barigozzi, H. Cho and P. Fryzlewicz (2016) Simultaneous multiple change-point and factor analysis for high-dimensional time series, Preprint.

H. Cho (2016) Change-point detection in panel data via double CUSUM statistic. Electronic Journal of Statistics. 10: 2000-2038.

Examples

Run this code
n <- 50; T <- 200
e <- matrix(rnorm(n*T), nrow=n) # idiosyncratic components
r <- 3 # factor number
Lam <- matrix(rnorm(n*r, 1, 1), nrow=n) # loadings
f <- matrix(rnorm(r*T), nrow=r) # factors
chi <- e*0 # common component
chp <- T/2 # change-point
chi[, 1:chp] <- Lam%*%f[, 1:chp]
Lam <- Lam + matrix(rnorm(n*r, 0, sqrt(2)), nrow=n) # new loadings
chi[, (chp+1):T] <- Lam%*%f[, (chp+1):T]
x <- chi + sqrt(r)*e

fsa <- factor.seg.alg(x, idio.diag=TRUE)
fsa$common.est.cps
fsa$idio.est.cps
fsa$q.seq

Run the code above in your browser using DataLab