M2.mle: Estimating the latent factors using maximum likelihood...

View source: R/M2.mle.R

M2.mleR Documentation

Estimating the latent factors using maximum likelihood methods

Description

Estimating the latent factors and factor loadings in high dimensional factor model using maximum likelihood methods based on the covariance or correlation matrix.

Usage

M2.mle(
  X,
  r,
  scale = F,
  method = c("ML", "QML", "ML-GLS", "ML-ITE", "ML-EM"),
  eps = 10^-6,
  ar.order = 1,
  ...
)

Arguments

X

A matrix or data frame with t rows (samples) and n columns (variables).

r

The number of factors.

scale

logical. If TRUE, the variance of columns of X are normalized to 1 before factor estimation.

method

Method to use: "ML", Maximum Likelihood method in Bai and Li (2012); "QML", Quasi-Maximum Likelihood method in Bai and Li (2013); "ML-GLS", Bai and Li (2013)'s two step "ML-GLS" method; "ML-ITE", Bai and Li (2013)'s Iterative "ML-GLS" method; "ML-EM", Bai and Li (2013)'s EM algorithm for Maximum Likelihood.

eps

The iteration error, default to 10^-8. Available for Maximum Likelihood methods.

ar.order

An integer. Auto regression lag for the idiosyncratic errors in ML-GLS and ML-ITE. If it is null, ar.order will be selected by AIC.

...

Any other parameters.

Value

A list of factors, factor loadings and other information, see below.

  • f Estimated factors.

  • u Estimated factor loadings.

  • e Estimated errors.

  • m2e Diagonal elements of the covariance matrix of errors, only provided in PCA and ML.

  • rho Auto regression coefficients of errors, only provided in ML-GLS, ML-ITE and ML-EM.

Examples

n = 100
t = 200
k = 2
par_f = list(rep(1,k),rep(0.8,k),rep(1,k),rep(Inf,k))
par_e = list(1,0,2,Inf)
rho_f = c(0.5,0.2)
par_cove = list(beta = 0.2,J = n/10,rho = 0.2,msig_e = c(1,5))
data = hofa.DGP2(n,t,k,par_f,par_e,par_cove,rho_f)$X
M2.mle(data,r = 2,method = "ML-EM")

GuanglinHuang/HOFA documentation built on Sept. 4, 2023, 10:23 p.m.