varcor {Tlasso} | R Documentation |
Variance Correction of Sample Covariance of Residuals
Description
Generate variance correction term of sample covariance of residuals described in Lyu et al. (2019).
Usage
varcor(data, Omega.list, k = 1)
Arguments
data |
tensor object stored in a m1 * m2 * ... * mK * n array, where n is sample size and mk is dimension of the kth tensor mode. |
Omega.list |
list of precision matrices of tensor, i.e., |
k |
index of interested mode, default is 1. |
Details
This function computes variance correction term of sample covariance of residuals and is utilized to normalize test statistic into standord normal, see Lyu et al. (2019).
Value
A scalar of variance correction for the kth mode.
Author(s)
Xiang Lyu, Will Wei Sun, Zhaoran Wang, Han Liu, Jian Yang, Guang Cheng.
See Also
Examples
m.vec = c(5,5,5) # dimensionality of a tensor
n = 5 # sample size
k=1 # index of interested mode
lambda.thm = 20*c( sqrt(log(m.vec[1])/(n*prod(m.vec))),
sqrt(log(m.vec[2])/(n*prod(m.vec))),
sqrt(log(m.vec[3])/(n*prod(m.vec))))
DATA=Trnorm(n,m.vec,type='Chain')
# obersavations from tensor normal distribution
out.tlasso = Tlasso.fit(DATA,T=1,lambda.vec = lambda.thm)
# output is a list of estimation of precision matrices
rho=covres(DATA, out.tlasso, k = k)
# sample covariance of residuals, including diagnoal
varpi2=varcor(DATA, out.tlasso, k = k)
# variance correction term for kth mode's sample covariance of residuals