Title: | Robust Factor Analysis for Tensor Time Series |
---|---|
Description: | Tensor Factor Models (TFM) are appealing dimension reduction tools for high-order tensor time series, and have wide applications in economics, finance and medical imaging. We propose an one-step projection estimator by minimizing the least-square loss function, and further propose a robust estimator with an iterative weighted projection technique by utilizing the Huber loss function. The methods are discussed in Barigozzi et al. (2022) <arXiv:2206.09800>, and Barigozzi et al. (2023) <arXiv:2303.18163>. |
Authors: | Matteo Barigozzi [aut], Yong He [aut], Lorenzo Trapani [aut], Lingxiao Li [aut, cre] |
Maintainer: | Lingxiao Li <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0 |
Built: | 2024-12-22 06:21:45 UTC |
Source: | CRAN |
This function is to estimate the tensor factor model via four different methods, namely the initial estimation without initial (IE), one-step projection estimation (PE), iterative projection estimation (iPE) and iterative weighted projection estimation by Huber loss (HUBER).
TFM_est(x, r, method = "PE", tol = 1e-04, maxiter = 100)
TFM_est(x, r, method = "PE", tol = 1e-04, maxiter = 100)
x |
|
r |
input rank of the factor tensor. |
method |
character string, specifying the type of the estimation method to be used.
|
tol |
tolerance in terms of the Frobenius norm. |
maxiter |
maximum number of iterations if error stays above |
See Barigozzi et al. (2022) and Barigozzi et al. (2023) for details.
return a list containing the following:
Ft
estimated factor processes of dimension .
Ft.all
Summation of factor processes over time, of dimension .
Q
a list of estimated factor loading matrices .
x.hat
fitted signal tensor, of dimension .
niter
number of iterations.
fnorm.resid
Frobenius norm of residuals, divide the Frobenius norm of the original tensor.
Matteo Barigozzi, Yong He, Lingxiao Li, Lorenzo Trapani.
Barigozzi M, He Y, Li L, Trapani L. Robust Estimation of Large Factor Models for Tensor-valued Time Series. <arXiv:2206.09800>
Barigozzi M, He Y, Li L, Trapani L. Statistical Inference for Large-dimensional Tensor Factor Model by Iterative Projection. <arXiv:2303.18163>
library(rTensor) set.seed(1234) p <- c(12,16,20) # dimensions of tensor time series r <- c(3,4,5) # dimensions of factor series A<-list() Q<-list() for(i in 1:3){ A[[i]]<-matrix(rnorm(p[i]*r[i],0,1),p[i],r[i]) Q[[i]]<-eigen(A[[i]]%*%t(A[[i]]))$vectors } T<-100 F<-array(NA,c(T,r)) E<-array(NA,c(T,p)) S<-array(NA,c(T,p)) X<-array(NA,c(T,p)) for(t in 1:T){ F[t,,,]<-array(rnorm(prod(r),0,1),r) E[t,,,]<-array(rnorm(prod(p),0,1),p) S[t,,,]<-ttl(as.tensor(F[t,,,]),A,c(1,2,3))@data X[t,,,]<-S[t,,,]+E[t,,,] } result <- TFM_est(X,r,method='PE') Q.hat<-result$Q Ft.hat <- result$Ft
library(rTensor) set.seed(1234) p <- c(12,16,20) # dimensions of tensor time series r <- c(3,4,5) # dimensions of factor series A<-list() Q<-list() for(i in 1:3){ A[[i]]<-matrix(rnorm(p[i]*r[i],0,1),p[i],r[i]) Q[[i]]<-eigen(A[[i]]%*%t(A[[i]]))$vectors } T<-100 F<-array(NA,c(T,r)) E<-array(NA,c(T,p)) S<-array(NA,c(T,p)) X<-array(NA,c(T,p)) for(t in 1:T){ F[t,,,]<-array(rnorm(prod(r),0,1),r) E[t,,,]<-array(rnorm(prod(p),0,1),p) S[t,,,]<-ttl(as.tensor(F[t,,,]),A,c(1,2,3))@data X[t,,,]<-S[t,,,]+E[t,,,] } result <- TFM_est(X,r,method='PE') Q.hat<-result$Q Ft.hat <- result$Ft
This function is to estimate factor numbers via eigenvalue-ratio criterion corresponding to initial estimation without projection, one-step projection estimation, iterative projection estimation and iterative weighted projection estimation by Huber loss.
TFM_FN(x, r = NULL, method = "PE", tol = 1e-04, maxiter = 100)
TFM_FN(x, r = NULL, method = "PE", tol = 1e-04, maxiter = 100)
x |
|
r |
input rank of the factor tensor. |
method |
character string, specifying the type of the factor estimation method to be used.
|
tol |
tolerance in terms of the Frobenius norm. |
maxiter |
maximum number of iterations if error stays above |
See Barigozzi et al. (2022) and Barigozzi et al. (2023) for details.
return a list containing the following:
path
a matrix of the estimated Tucker rank of the factor process as a path of the maximum number of iteration (
) used. The
-th column is the estimated rank
at
-th iteration.
factor.num
final solution of the estimated Tucker rank of the factor process .
Matteo Barigozzi, Yong He, Lingxiao Li, Lorenzo Trapani.
Barigozzi M, He Y, Li L, Trapani L. Robust Estimation of Large Factor Models for Tensor-valued Time Series. <arXiv:2206.09800>
Barigozzi M, He Y, Li L, Trapani L. Statistical Inference for Large-dimensional Tensor Factor Model by Iterative Projection. <arXiv:2303.18163>
library(rTensor) set.seed(1234) p <- c(12,16,20) # dimensions of tensor time series r <- c(3,4,5) # dimensions of factor series A<-list() Q<-list() for(i in 1:3){ A[[i]]<-matrix(rnorm(p[i]*r[i],0,1),p[i],r[i]) Q[[i]]=eigen(A[[i]]%*%t(A[[i]]))$vectors } T<-100 F<-array(NA,c(T,r)) E<-array(NA,c(T,p)) S<-array(NA,c(T,p)) X<-array(NA,c(T,p)) for(t in 1:T){ F[t,,,]<-array(rnorm(prod(r),0,1),r) E[t,,,]<-array(rnorm(prod(p),0,1),p) S[t,,,]<-ttl(as.tensor(F[t,,,]),A,c(1,2,3))@data X[t,,,]<-S[t,,,]+E[t,,,] } rank<-TFM_FN(X,r=NULL,method='PE')
library(rTensor) set.seed(1234) p <- c(12,16,20) # dimensions of tensor time series r <- c(3,4,5) # dimensions of factor series A<-list() Q<-list() for(i in 1:3){ A[[i]]<-matrix(rnorm(p[i]*r[i],0,1),p[i],r[i]) Q[[i]]=eigen(A[[i]]%*%t(A[[i]]))$vectors } T<-100 F<-array(NA,c(T,r)) E<-array(NA,c(T,p)) S<-array(NA,c(T,p)) X<-array(NA,c(T,p)) for(t in 1:T){ F[t,,,]<-array(rnorm(prod(r),0,1),r) E[t,,,]<-array(rnorm(prod(p),0,1),p) S[t,,,]<-ttl(as.tensor(F[t,,,]),A,c(1,2,3))@data X[t,,,]<-S[t,,,]+E[t,,,] } rank<-TFM_FN(X,r=NULL,method='PE')