factor.seg.alg: Simultaneous multiple change-point and factor analysis for...

Description Usage Arguments Value Author(s) References Examples

View source: R/package.R

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

1
2
3
4
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

cs.list

a list of objects returned by an internal function common.seg, which contain the results from performing change-point analysis on the common components estimated with a range of factor number candidates

r

the factor number selected from performing change-point analysis on the common component

common.est.cps

change-points detected from the common component estimated with r as the factor number

idio.seg.res

an object returned by an internal function idio.seg, which contains the results from performing change-point analysis on the idiosyncratic component estimated with r as the factor number

idio.est.cps

change-points detected from the idiosyncratic component

gfm

factor structure of x estimated from get.factor.model

q.seq

a vector containing the range of factor number candidates

Author(s)

Haeran Cho

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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

factorcpt documentation built on May 2, 2019, 8:15 a.m.