HPCA: Huber Principal Component Analysis for Large-Dimensional...

View source: R/HPCA.R

HPCAR Documentation

Huber Principal Component Analysis for Large-Dimensional Factor Models

Description

This function is to fit the factor models via the Huber Principal Component Analysis (HPCA) method. One is based on minimizing the Huber loss of the idiosyncratic error's \ell_2 norm, which turns out to do Principal Component Analysis (PCA) on the weighted sample covariance matrix and thereby named as Huber PCA. The other one is based on minimizing the elementwise Huber loss, which can be solved by an iterative Huber regression algorithm.

Usage

HPCA(X, r, Method = "E", tau = NULL, scale_est="MAD", L_init = NULL, 
     F_init = NULL, maxiter_HPCA = 100, maxiter_HLM = 100, eps = 0.001)

Arguments

X

Input matrix, of dimension T\times N. Each row is an observation with N features at time point t.

r

A positive integer indicating the factor numbers.

Method

Method="P" indicates minimizing the Huber loss of the idiosyncratic error's \ell_2 norm while Method="E" indicates minimizing the elementwise Huber loss. The default is the elementwise Huber loss.

tau

Optional user-supplied parameter for Huber loss; default is NULL, and \tau is provided by default.

scale_est

A parameter for the elementwise Huber loss. scale_est="MAD" indicates robust variance estimation in each iteration, while scale_est="const" indicates fixing user-supplied \tau. The default is scale_est="MAD".

L_init

User-supplied inital value of loadings; default is the PCA estimator.

F_init

User-supplied inital value of factors; default is the PCA estimator.

maxiter_HPCA

The maximum number of iterations in the HPCA. The default is 100.

maxiter_HLM

The maximum number of iterations in the iterative Huber regression algorithm. The default is 100.

eps

The stopping critetion parameter in the HPCA. The default is 1e-3.

Details

See He et al. (2023) for details.

Value

The return value is a list. In this list, it contains the following:

Fhat

The estimated factor matrix of dimension T\times r.

Lhat

The estimated loading matrix of dimension N\times r.

m

The number of iterations.

Author(s)

Yong He, Lingxiao Li, Dong Liu, Wenxin Zhou.

References

He Y, Li L, Liu D, Zhou W., 2023 Huber Principal Component Analysis for Large-dimensional Factor Models.

Examples

set.seed(1)
T=50;N=50;r=3
L=matrix(rnorm(N*r,0,1),N,r);F=matrix(rnorm(T*r,0,1),T,r)
E=matrix(rnorm(T*N,0,1),T,N)
X=F%*%t(L)+E

fit=HPCA(X,r,Method = "E")
fit$Fhat;fit$Lhat

fit=HPCA(X,r,Method = "P")
fit$Fhat;fit$Lhat

HDRFA documentation built on Sept. 11, 2024, 9:25 p.m.

Related to HPCA in HDRFA...