Generate new data using the fitted values of the parameters
# S3 method for class 'gllvm'
simulate(object, nsim = 1, seed = NULL, conditional = FALSE, newX = NULL, ...)an object of class 'gllvm'.
an optional positive integer specifying the number of simulated datasets. Defaults to 1.
an optional integer to set seed number, passed to set.seed. Defaults to a random seed number.
if conditional = FALSE simulates marginally over the latent variables.
A new data frame of environmental variables. If omitted, the original matrix of environmental variables is used.
not used.
A matrix containing generated data.
simulate function for gllvm objects.
# \donttest{
# Load a dataset from the mvabund package
data(antTraits, package = "mvabund")
y <- as.matrix(antTraits$abund)
X <- scale(antTraits$env[, 1:3])
# Fit gllvm model
fit <- gllvm(y = y, X, family = poisson())
#> Warning: 65 parameter(s) have negative variance estimates (lambda x63, sigmaLV x2). The model likely has not converged - consider re-fitting.
# Simulate data
newdata <- simulate(fit)
# }