gendata: Generate simulated data

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

View source: R/hello.R

Description

Generate simulated data from high dimensional group-sparse factor model.

Usage

1
  gendata(n, p, seed=1, q=6, pzero= floor(p/4), sigma2=0.1, gamma=1, heter=F, 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

1
2
  dat <- gendata(n=300, p = 500)
  str(dat)

feiyoung/SpagFainfer documentation built on April 4, 2020, 5:20 p.m.