rank_factors_est {TensorPreAve}R Documentation

Rank and Factor Loadings Estimation

Description

The complete procedure to estimate both rank and factor loading matrices simultaneously for a tensor time series.

Usage

rank_factors_est(
  X,
  proj_N = 30,
  r_range = NULL,
  C_range = NULL,
  M0 = 200,
  M = 5,
  B = 50,
  eigen_j = NULL,
  input_r = NULL
)

Arguments

X

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

proj_N

Number of iterations for iterative projection. Default is 30.

r_range

Approximate range of r_k (number of factors) to search from, written in a list of K vectors (e.g. z = list(c(1,10),c(1,10)) for K = 2). Default range is 1 to 10 for all modes.

C_range

The range of constant C for calculating threshold. Default is seq(0,100,0.1), Default is seq(0,100,0.1), and set to be automatically tuned as data-driven.

M0

Number of random samples to generate in pre-averaging procedure. Default is 200.

M

Number of chosen samples for pre-averaging. Usually can be set as constants (5 or 10) or 2.5 percents of M0. Default is 5.

B

Number of bootstrap samples for estimating rank of core tensor by bootstrapped correlation thresholding. Default is 50. Can be set as 10 when dimension is large.

eigen_j

The j-th eigenvalue to calculate eigenvalue-ratio for a randomly chosen sample, written as a vector of length K. Default is d_k/2 for all modes. Can be manually tuned using function pre_eigenplot.

input_r

The rank of core tensor if it is already know, written as a vector of length K. If no input, it will be estimated. Default is NULL.

Details

Input a tensor time series and return the estimated factor loading matrices and rank of core tensor.

Value

A list containing the following:
rank: A vector of K elements, indicating the estimated number of factors in each mode
loadings: A list of K estimated factor loading matrices.

Examples

# Example of real data set
set.seed(10)
results = rank_factors_est(value_weight_tensor)
results


# 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
results = rank_factors_est(X)
results


[Package TensorPreAve version 1.1.0 Index]