Generate simulated data from high dimensional genelized nonlinear factor model.
gendata(seed = 1, n = 300, p = 50,
type = c('homonorm', 'heternorm',
'pois', 'bino', 'norm_pois', 'pois_bino', 'npb'),
q = 6, rho = 1, n_bin=1)
return a list including two components:
a n
-by-p
matrix, the observed data matrix.
a list consisting of the above observed data matrices with the same rows n (observations), and different columns (p1,p2, ..., p_d) and p columns in total, where d is the types of variables, pj is the dimension of varibles with the j-th type.
a n
-by-q
matrix, the true lantent factor matrix.
a p
-by-q
matrix, the true loading matrix, the last pzero rows are vectors of zeros.
a p-dimensional vector, the true intercept terms.
a nonnegative integer, the random seed, default as 1.
a positive integer, the sample size.
an positive integer, the variable dimension.
a character, specify the variables types for generated data, default as 'homonorm', representing the homogeneous gaussian variables.
a positive integer, the number of factors.
a positive number, controlling the magnitude of loading matrix.
a positive integer, specify the number of trails for the binomial variables when type
is set to one of 'bino', 'pois_bino' and 'npb'.
Wei Liu
This function provides a variaty of mix of different variable types, in which 'homonorm' represents the generated data with only homogenous normal variables; 'heternorm' represents the data with only heterogenous normal variables; 'pois' means the data with only poisson variables; 'bino' means the data with only binomial variables; 'norm_pois' means the mix of normal and poisson variables; 'pois_bino' represents the mix of poisson and binomial variables; and 'npb' means the most complex mix of normal, poisson and binomial variables.
Factorm; gfm
.
dat <- gendata(n=300, p = 500)
str(dat)
Run the code above in your browser using DataLab