pre_est: Pre-Averaging Estimator

View source: R/pre_est.R

pre_estR Documentation

Pre-Averaging Estimator

Description

Function for the initial Pre-Averaging Procedure.

Usage

pre_est(X, z = rep(1, X@num_modes - 1), M0 = 200, M = 5, eigen_j = NULL)

Arguments

X

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

z

(Estimated) Rank of the core tensor, written as a vector of length K. For iterative projection purpose, we only need this to be 1's. Default is 1's.

M0

Number of random samples to generate, should be a positive integer. Default is 200.

M

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

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.

Details

Input a tensor time series and return the estimated factor loading matrices (or directions) using pre-averaging method.

Value

A list of K estimated factor loading matrices.

Examples

# Example of a real data set
set.seed(10)
Q_PRE = pre_est(value_weight_tensor)
Q_PRE

set.seed(10)
Q_PRE_2 = pre_est(value_weight_tensor, z = c(2,2))
Q_PRE_2


# 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, z = r)
Q_PRE


TensorPreAve documentation built on April 14, 2023, 5:13 p.m.