cord: Model based ordination with Gaussian copulas

View source: R/cord.R

cordR Documentation

Model based ordination with Gaussian copulas

Description

Model based ordination with Gaussian copulas

Usage

cord(obj, nlv = 2, n.samp = 500, seed = NULL)

Arguments

obj

object of either class manyglm, or manyany with ordinal models clm

nlv

number of latent variables (default = 2, for plotting on a scatterplot)

n.samp

integer (default = 500), number of sets residuals used for importance sampling (optional, see detail)

seed

integer (default = NULL), seed for random number generation (optional)

Value

loadings latent factor loadings scores latent factor scores sigma covariance matrix estimated with nlv latent variables theta precision matrix estimated with nlv latent variables BIC BIC of estimated model logL log-likelihood of estimated model

Details

cord is used to fit a Gaussian copula factor analytic model to multivariate discrete data, such as co-occurrence (multi species) data in ecology. The model is estimated using importance sampling with n.samp sets of randomised quantile or "Dunn-Smyth" residuals (Dunn & Smyth 1996), and the factanal function. The seed is controlled so that models with the same data and different predictors can be compared.

Author(s)

Gordana Popovic <g.popovic@unsw.edu.au>.

References

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

Popovic, G. C., Hui, F. K., & Warton, D. I. (2018). A general algorithm for covariance modeling of discrete data. Journal of Multivariate Analysis, 165, 86-100.

See also

plot.cord

Examples

abund <- spider$abund
spider_mod <- stackedsdm(abund,~1, data = spider$x, ncores=2) 
spid_lv=cord(spider_mod)
plot(spid_lv,biplot = TRUE)

ecoCopula documentation built on March 18, 2022, 6:56 p.m.