powered by
Factor analysis to extract latent linear factor and estimate loadings.
Factorm(X, q=NULL)
return a list with class named fac, including following components:
fac
a n-by-q matrix, the extracted lantent factor matrix.
n
q
a p-by-q matrix, the estimated loading matrix.
p
an integer between 1 and p, the number of factor extracted.
a p-dimensional vector, the estimated variance for each error term in model.
a positive number between 0 and 1, the explained propotion of cummulative variance by the q factors.
a n-dimensional(n<=p) or p-dimensional(p<n) vector, the eigenvalues of sample covariance matrix.
a n-by-p matrix, the observed data
an integer between 1 and p or NULL, default as NULL and automatically choose q by the eigenvalue ratio method.
NULL
Liu Wei
Fan, J., Xue, L., and Yao, J. (2017). Sufficient forecasting using factor models. Journal of Econometrics.
gfm.
gfm
dat <- gendata(n = 300, p = 500) res <- Factorm(dat$X) measurefun(res$hH, dat$H0) # the smallest canonical correlation
Run the code above in your browser using DataLab