gendata_mmgfm {MMGFM}R Documentation

Generate simulated data

Description

Generate simulated data from MMGFM models

Usage

gendata_mmgfm(
  seed = 1,
  nvec = c(300, 200),
  pveclist = list(gaussian = c(50, 150), poisson = c(50), binomial = c(100, 60)),
  q = 6,
  d = 3,
  qs = rep(2, length(nvec)),
  rho = rep(1, length(pveclist)),
  rho_z = 1,
  sigmavec = rep(0.5, length(pveclist)),
  n_bin = 1,
  sigma_eps = 1,
  heter_error = FALSE
)

Arguments

seed

a postive integer, the random seed for reproducibility of data generation process.

nvec

a vector with postive integers, specify the sample size in each study/source.

pveclist

a named list, specify the number of modalities for each type and variable dimension in each type of modatlity.

q

a postive integer, specify the number of study-shared factors.

d

a postive integer, specify the dimension of covariate matrix.

qs

a vector with postive integers, specify the number of study-specified factors.

rho

a numeric vector with length(pveclist) and positive elements, specify the signal strength of loading matrices for each modality type.

rho_z

a positive real, specify the signal strength of covariates.

sigmavec

a positive real vector with length(pveclist), specify the variance of study-specified and modality variable-shared factors; default as 0.5 for each element.

n_bin

a positive integer, specify the number of trails when generate Binomial modality matrix; default as 1.

sigma_eps

a positive real, the variance of overdispersion error; default as 1.

heter_error

a logical value, whether to generate the heterogeneous error; default as FALSE.

Value

return a list including the following components:

Examples

q <- 3; qsvec<-rep(2,3)
nvec <- c(100, 120, 100)
pveclist <-  list('gaussian'=rep(150, 1),'poisson'=rep(50, 2),'binomial'=rep(60, 2))
datlist <- gendata_mmgfm(seed = 1,  nvec = nvec, pveclist =pveclist,
                         q = q,  d= 3,qs = qsvec,  rho = rep(3,length(pveclist)), rho_z=0.5,
                         sigmavec=rep(0.5, length(pveclist)),  sigma_eps=1)

[Package MMGFM version 1.1.0 Index]