biascor: Bias Correction of Sample Covariance of Residuals

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/biascor.R

Description

Generate a matrix of bias-corrected sample covariance of residuals (excludes diagnoal) described in Lyu et al. (2019).

Usage

1
biascor(rho, Omega.list, k = 1)

Arguments

rho

matrix of sample covariance of residuals (includes diagnoal), e.g., output of covres.

Omega.list

list of precision matrices of tensor, i.e., Omega.list[[k]] is the precision matrix for the kth tensor mode, 1 <= k <= K . For example, output of link{Tlasso.fit}.

k

index of interested mode, default is 1.

Details

This function computes bias-corrected sample covariance of residuals (excludes diagnoal, diagnoal is zero vector). Note that output matrix excludes diagnoal while sample covariance of residuals includes diagnoal, see Lyu et al. (2019) for details. Elements in Omega.list are true precision matrices or estimation of the true ones, the latter can be output of Tlasso.fit.

Value

A matrix whose (i,j) entry (excludes diagnoal; diagnoal is zero vector) is bias-corrected sample covariance of the ith and jth residuals in the kth mode. See Lyu et al. (2019) for details.

Author(s)

Xiang Lyu, Will Wei Sun, Zhaoran Wang, Han Liu, Jian Yang, Guang Cheng.

See Also

varcor, covres

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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 
bias_rho=biascor(rho,out.tlasso,k=k)
bias_rho # bias-corrected sample covariance of residuals
# diagnoal is zero vector

Tlasso documentation built on Feb. 1, 2022, 9:07 a.m.