M2.gmm: Estimating the latent factors using generalized moment...

View source: R/M2.gmm.R

M2.gmmR Documentation

Estimating the latent factors using generalized moment methods

Description

Estimating the latent factors and factor loadings in high dimensional factor model using generalized moment methods based on the covariance matrix.

Usage

M2.gmm(
  X,
  r,
  kappa = 0,
  sigma_e = NULL,
  initial = c("PCA", "MLE"),
  W_diag = FALSE,
  identity = FALSE,
  delta = NULL,
  eps = 10^-6,
  ...
)

Arguments

X

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

r

The number of factors.

kappa

An integer. The weight between M and VWV, M denotes the covariance matrix and VWV denotes the GMM matrix. kappa default to 0.

sigma_e

A n x 1 vector, the variance of the error terms. If it is NULL, the variance vector will be initialized by PCA or MLE.

initial

The method used to initialize the factor loadings and the variance of errors. PCA denotes Principal Component Analysis and MLE denotes Maximum Likelihood Estimation in Bai and Li(2012).

W_diag

Logical. If TRUE, the weight matrix W only has nonzero diagonal elements, default to FALSE.

identity

Logical. If TRUE, the variances of errors are unified to identity, default to FALSE.

delta

An integer. The hard threshold value of W matrix in order to guarantee non-singularity of W, default to 1/log(t).

eps

The iteration error, default to 10^-6. Available for initializing the estimators by Maximum Likelihood method.

...

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.

  • ev Eigenvalues of covariance matrix.

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.gmm(data,r = 2,kappa = 0,sigma_e = rep(1,n),initial = "PCA")

GuanglinHuang/hofa documentation built on Sept. 3, 2023, 7:01 a.m.