generate_glmpca_data_pois {fastglmpca}R Documentation

Generate Data from a GLMCPA Model

Description

Generate data from a GLMPCA model with a specified rank.

Usage

generate_glmpca_data_pois(n, p, K, link = c("log", "log1p"))

Arguments

n

Number of rows (genes).

p

Number of columns (cells).

K

Rank of the underlying mean structure

link

Character vector describing the link between the product of the loading and factors and the mean of the data.

Details

This function assumes that each column of the data is generated from a multinomial distribution. Let

YjY_j

denote column j of the generated data matrix. First, we set

sum(Yj)sum(Y_j)

equal to a value generated from a

Uniform(50,5000)Uniform(50, 5000)

distribution. Then, we generate

LL

and

FF

from mixture distributions, and calculate

H=exp(LF)H = exp(L'F)

. Then, we generate the individual elements of

YjY_j

from a multinomial model where the probability for each individual element is just

HjH_j

normalized.

Value

list with the following components

Examples

set.seed(1)
sim_data <- generate_glmpca_data_pois(1000, 500, 1)


[Package fastglmpca version 0.1-103 Index]