Learn R Programming

factorcpt (version 0.1.2)

get.factor.model: Factor model estimation via Principal Component Analysis

Description

Estimates the components of the factor structure for an input time series, such as loadings and factors, as well as estimating the number of factors.

Usage

get.factor.model(x, max.q = NULL, q = NULL, bn = TRUE, bn.op = 2, normalisation = TRUE)

Arguments

x
input time series matrix, with each row representing a time series
max.q
see max.q in factor.seg.alg
q
the number of factors; if bn=FALSE, q needs to be given
bn
if bn=TRUE, the factor number is estimated using the information criterion-based estimator of Bai and Ng (2002)
bn.op
an index number for the information criterion-based estimator of Bai and Ng (2002); the default value bn.op=2 is used in Barigozzi, Cho & Fryzlewicz (2016)
normalisation
if normalisation=TRUE, each row x is standardised prior to PCA

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.

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 <- Lam%*%f
x <- chi + sqrt(r)*e

gfm <- get.factor.model(x)
gfm$q.hat

Run the code above in your browser using DataLab