Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

simulate.gllvm

Simulate data from gllvm fit


Description

Generate new data using the fitted values of the parameters

Usage

## S3 method for class 'gllvm'
simulate(object, nsim = 1, seed = NULL, conditional = FALSE, ...)

Arguments

object

an object of class 'gllvm'.

nsim

an optional positive integer specifying the number of simulated datasets. Defaults to 1.

seed

an optional integer to set seed number, passed to set.seed. Defaults to a random seed number.

conditional

if conditional = FALSE simulates marginally over the latent variables.

...

not used.

Details

simulate function for gllvm objects.

Value

A matrix containing generated data.

Author(s)

David Warton, Jenni Niku <jenni.m.e.niku@jyu.fi>

Examples

# Load a dataset from the mvabund package
data(antTraits)
y <- as.matrix(antTraits$abund)
X <- scale(antTraits$env[, 1:3])
# Fit gllvm model
fit <- gllvm(y = y, X, family = poisson())
# Simulate data
newdata <- simulate(fit)

gllvm

Generalized Linear Latent Variable Models

v1.3.0
GPL-2
Authors
Jenni Niku [aut, cre], Wesley Brooks [aut], Riki Herliansyah [aut], Francis K.C. Hui [aut], Sara Taskinen [aut], David I. Warton [aut], Bert van der Veen [aut]
Initial release
2021-4-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.