Learn R Programming

TensorPreAve (version 1.1.0)

iter_proj: Iterative Projection Estimator.

Description

Function for Iterative Projection Direction Refinement to re-estimate the factor loading matrices.

Usage

iter_proj(X, initial_direction, proj_N = 30, z = rep(1, X@num_modes - 1))

Value

A list of \(K\) estimated factor loading matrices.

Arguments

X

A 'Tensor' object defined in package rTensor with \(K+1\) modes. Mode-1 should correspond to the time mode.

initial_direction

Initial direction for projection, written in a list of \(K\) vectors. This can be obtained from the pre-averaging procedure by using function pre_est.

proj_N

Number of iterations, should be a positive integer. Default is 30.

z

(Estimated) Rank of the core tensor, written as a vector of length \(K\). Can be set as 1's when we only need to do rank estimation based on projected data. Default is 1's.

Details

Input a tensor time series and initial estimated directions corresponding to the strongest factors, return the estimated factor loading matrices (or directions) using the Algorithm for Iterative Projection Direction Refinement.

Examples

Run this code
# Example of a real data set
set.seed(10)
Q_PRE = pre_est(value_weight_tensor)
Q_PROJ = iter_proj(value_weight_tensor, initial_direction = Q_PRE)
Q_PROJ

set.seed(10)
Q_PRE = pre_est(value_weight_tensor)
Q_PROJ_2 = iter_proj(value_weight_tensor, initial_direction = Q_PRE, z = c(2,2))
Q_PROJ_2

# \donttest{
# Example using generated data
K = 2
T = 100
d = c(40,40)
r = c(2,2)
re = c(2,2)
eta = list(c(0,0),c(0,0))
u = list(c(-2,2),c(-2,2))
set.seed(10)
Data_test = tensor_data_gen(K,T,d,r,re,eta,u)
X = Data_test$X
Q_PRE = pre_est(X)
Q_PROJ = iter_proj(X, initial_direction = Q_PRE, z = r)
Q_PROJ
# }

Run the code above in your browser using DataLab