residuals.regional_mix: Residuals for a regional_mix object

residuals.regional_mixR Documentation

Residuals for a regional_mix object

Description

The randomised quantile residuals ("RQR", from Dunn and Smyth, 1996) are defined by their marginal distribution function (marginality is over other species observations within that site; see Foster et al, in prep). The result is one residual per species per site and they all should be standard normal variates. Within a site they are likely to be correlated (as they share a common latent factor), but across sampling locations they will be independent. The deviance residuals (as used here), are actually just square root of minus two times the log-likelihood contribution for each sampling location. We do not subtract the log-likelihood of the saturated model as, at the time of writing, we are unsure what this log-likelihood should be (latent factors confuse things here). This implies that the residuals will not have mean zero and their variance might also be heteroskedastic. This was not realised when writing the original RCP paper (Foster et al, 2013), obviously. We still believe that these residuals have some utility, but we are unsure where that utility stops. For general useage, the "RQR" residuals should probably be preferred.

Usage

## S3 method for class 'regional_mix'
residuals(object, ..., type = "RQR", quiet = FALSE, mc.cores = 1)

Arguments

object

A regional_mix model

type

What type of residuals to plot? 'RQR'; random quantile residuals or 'deviance' residuals.

quiet

Run in quiet mode.

mc.cores

the number of cores to farm the jobs out to.

\dots

Additional arguments for residuals function

Value

For type=="RQR", a number-of-sites by number-of-species matrix with the randomised quantile residuals, which should be distributed as a standard normal variate.
For type=="deviance" a numeric vector of size object$n containing the deviance residuals.

References

Dunn, P.K. and Smyth G.K. (1996) Randomized Quantile Residuals. Journal of Computational and Graphical Statistics 5: 236–244. Foster, S.D., Givens, G.H., Dornan, G.J., Dunstan, P.K. and Darnell, R. (2013) Modelling Regions of Common Profiles Using Biological and Environmental Data. Environmetrics 24: 489–499. DOI: 10.1002/env.2245 Foster, S.D., Hill, N.A. and Lyons, M., 2017. Ecological grouping of survey sites when sampling artefacts are present. Journal of the Royal Statistical Society: Series C (Applied Statistics), 66(5), pp.1031-1047.


skiptoniam/ecomix documentation built on Sept. 14, 2023, 6:04 a.m.