Learn R Programming

Tlasso (version 1.0.2)

Trnorm: Separable Tensor Normal Distribution

Description

Generate observations from separable tensor normal distribution.

Usage

Trnorm(
  n,
  m.vec,
  mu = array(0, m.vec),
  Sigma.list = NULL,
  type = "Chain",
  sd = 1,
  knn = 4,
  norm.type = 2
)

Arguments

n

number of generated observations.

m.vec

vector of tensor mode dimensions, e.g., m.vec=c(m1, m2, m3) for a 3-mode tensor normal distribution.

mu

array of mean for tensor normal distribution with dimension m.vec. Default is zero mean.

Sigma.list

list of covariance matrices in mode sequence. Default is NULL.

type

type of precision matrix, default is 'Chain'. Optional values are 'Chain' for triangle graph and 'Neighbor' for nearest-neighbor graph. Useless if Sigma.list is not NULL.

sd

seed of random number generation, default is 1.

knn

sparsity of precision matrix, i.e., matrix is generated from a knn nearest-neighbor graph. Default is 4. Useless if type='Chain' or Sigma.list is not NULL.

norm.type

normalization method of precision matrix, i.e., \(\Omega_{11} = 1\) if norm.type = 1 and \(\|\Omega\|_{F}=1\) if norm.type = 2. Default value is 2.

Value

An array with dimension m_1 * ... * m_K * n.

Details

This function generates obeservations from separable tensor normal distribution and returns a m1 * ... * mK * n array. If Sigma.list is not given, default distribution is from either triangle graph or nearest-neighbor graph (depends on type).

See Also

ChainOmega, NeighborOmega

Examples

Run this code
# NOT RUN {
 
m.vec = c(5,5,5)  # dimensionality of a tensor 
n = 5   # sample size 
DATA=Trnorm(n,m.vec,type='Chain') 
# a 5*5*5*10 array of oberservation from 5*5*5 separable tensor 
#     normal distribtuion with mean zero and 
#         precision matrices from triangle graph

# }

Run the code above in your browser using DataLab