gendata_Fac {TOSI}R Documentation

Generate simulated data

Description

Generate simulated data from high dimensional sparse factor model.

Usage

  gendata_Fac(n, p, seed=1, q=6, pzero= floor(p/4),
              sigma2=0.1, gamma=1, heter=FALSE, rho=1)

Arguments

n

a positive integer, the sample size.

p

an positive integer, the variable dimension.

seed

a nonnegative integer, the random seed, default as 1.

q

a positive integer, the number of factors.

pzero

a positive integer, the number of zero loading vectors, default as p/4.

sigma2

a positive real number, the homogenous variance of error term.

gamma

a positive number, the common component of heteroscedasticity of error term.

heter

a logical value, indicates whether generate heteroscendastic error term.

rho

a positive number, controlling the magnitude of loading matrix.

Value

return a list including two components:

X

a n-by-p matrix, the observed data matrix.

H0

a n-by-q matrix, the true lantent factor matrix.

B0

a p-by-q matrix, the true loading matrix, the last pzero rows are vectors of zeros.

ind_nz

a integer vector, the index vector for which rows of B0 not zeros.

Note

nothing

Author(s)

Liu Wei

See Also

Factorm.

Examples

  dat <- gendata_Fac(n=300, p = 500)
  str(dat)

[Package TOSI version 0.3.0 Index]