Learn R Programming

gllvm (version 2.0.5)

getPredictErr.gllvm: Extract prediction errors for latent variables from gllvm object

Description

Calculates the prediction errors for latent variables and random effects for gllvm model.

Usage

# S3 method for gllvm
getPredictErr(object, CMSEP = TRUE, cov = FALSE, ...)

Value

Function returns following components:

lvs

prediction errors for latent variables

row.effects

prediction errors for random row effects if included

Arguments

object

an object of class 'gllvm'.

CMSEP

logical, if TRUE conditional mean squared errors for predictions are calculated. If FALSE, prediction errors are based on covariances of the variational distributions for method ="VA" and method ="EVA".

cov

if TRUE, return as covariances/variances of predictions. Otherwise FALSE (default) return as standard errors of predictions.

...

not used

Author

Francis K.C. Hui, Jenni Niku, David I. Warton

Details

Calculates conditional mean squared errors for predictions. If variational approximation is used, prediction errors can be based on covariances of the variational distributions, and therefore they do not take into account the uncertainty in the estimation of (fixed) parameters.

Examples

Run this code
if (FALSE) {
# Load a dataset from the mvabund package
data(antTraits, package = "mvabund")
y <- as.matrix(antTraits$abund)
# Fit gllvm model
fit <- gllvm(y = y, family = poisson())
# prediction errors for latent variables:
getPredictErr(fit)
}

Run the code above in your browser using DataLab