Learn R Programming

GCCfactor (version 1.0.1)

PC: Principal component (PC) estimation of the approximate factor model

Description

Perform PC estimation of the (2D) approximate factor model: $$y_{it}=\boldsymbol{\lambda}_{i}^{\prime}\boldsymbol{F}_{t}+e_{it},$$ or in matrix notation: $$\boldsymbol{Y}=\boldsymbol{F}\boldsymbol{\Lambda}^{\prime}+\boldsymbol{e}.$$ The factors \(\boldsymbol{F}\) is estimated as \(\sqrt{T}\) times the \(r\) eigenvectors of the matrix \(\boldsymbol{Y}\boldsymbol{Y}^{\prime}\) corresponding to the \(r\) largest eigenvalues in descending order, and the loading matrix is estimated by \(\boldsymbol{\Lambda}=T^{-1}\boldsymbol{Y}^{\prime}\boldsymbol{F}\). See e.g. Bai and Ng (2002).

Usage

PC(Y, r)

Value

A list containing the factors and factor loadings:

  • factor = a \(T \times r\) matrix of the estimated factors.

  • loading = a \(N \times r\) matrix of the estimated factor loadings.

Arguments

Y

A \(T \times N\) data matrix. T = number of time series observations, N = cross-sectional dimension.

r

= the number of factors.

References

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

Examples

Run this code

# simulate data

T <- 100
N <- 50
r <- 2
F <- matrix(stats::rnorm(T * r, 0, 1), nrow = T)
Lambda <- matrix(stats::rnorm(N * r, 0, 1), nrow = N)
err <- matrix(stats::rnorm(T * N, 0, 1), nrow = T)
Y <- F %*% t(Lambda) + err

# estimation

est_PC <- PC(Y, r)

Run the code above in your browser using DataLab