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

residuals.gllvm

Dunn-Smyth residuals for gllvm model


Description

Calculates Dunn-Smyth residuals for gllvm model.

Usage

## S3 method for class 'gllvm'
residuals(object, ...)

Arguments

object

an object of class 'gllvm'.

...

not used.

Details

Computes Dunn-Smyth residuals (randomized quantile residuals, Dunn and Smyth, 1996) for gllvm model. For the observation Y_{ij} Dunn-Smyth residuals are defined as

r_{ij}=Φ^{-1}(u_{ij}F_{ij}(y_{ij}) + (1-u_{ij})F_{ij}^-(y_{ij})),

where Φ(.) and F_{ij}(.) are the cumulative probability functions of the standard normal distribution, F_{ij}^-(y)) is the limit as F_{ij}(y) is approached from the negative side, and u_{ij} has been generated at random from the standard uniform distribution.

Value

residuals

matrix of residuals

linpred

matrix of linear predictors

Author(s)

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

References

Dunn, P. K., and Smyth, G. K. (1996). Randomized quantile residuals. Journal of Computational and Graphical Statistics, 5, 236-244.

Hui, F. K. C., Taskinen, S., Pledger, S., Foster, S. D., and Warton, D. I. (2015). Model-based approaches to unconstrained ordination. Methods in Ecology and Evolution, 6:399-411.

Examples

## Not run: 
# Load a dataset from the mvabund package
data(antTraits)
y <- as.matrix(antTraits$abund)
# Fit gllvm model
fit <- gllvm(y = y, family = poisson())
# residuals
res <- residuals(fit)

## End(Not run)

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.