Learn R Programming

gcmr (version 0.3)

residuals.gcmr: Quantile Residuals from Fitted Marginal Regression Models

Description

Computes various type of quantile residuals for validation of a fitted Gaussian copula marginal regression model described by Masarotto and Varin (2011).

Usage

## S3 method for class 'gcmr':
residuals(object, type=c("conditional","marginal"),
          method=c("random","mid"),...)

Arguments

object
an object of class gcmr, typically the result of a call to gcmr.
type
the type of quantile residuals which should be returned. The alternatives are: "conditional" (default) and "marginal".
method
different methods available for quantile residuals in case of noncontinuous responses: "random" for randomized quantile residuals (default), and "mid" for mid interval quantile residuals as defined in Zucchini and MacDon
...
further arguments passed to or from other methods.

Details

Quantile residuals are defined in Dunn and Smyth (1996). Two different types are available: ll{ conditional quantile residuals that account for the dependence. marginal quantile residuals that do not account for the dependence. } Conditional quantile residuals are normal quantiles of Rosenblatt (1952) transformations and they are appropriate for validation of the marginal regression models discussed by Masarotto and Varin (2011). If the responses are noncontinuous, then the conditional quantile residuals are not well defined. This difficulty is overcame by randomized quantile residuals available through option method="random". Alternatively, Zucchini and MacDonald (2009) suggest the use of mid interval quantile residuals (method="mid"). Note that randomized quantile residuals are realizations of independent standard normal variables under model conditions, while mid quantile residuals are not.

References

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

Masarotto, G. and Varin, C. (2011). Gaussian copula marginal regression. Preprint.

Rosenblatt, M. (1952). Remarks on a multivariate transformation. The Annals of Mathematical Statistics 23, 470--472.

Zucchini, W. and MacDonald, I.L. (2009). Hidden Markov Models for Time Series. Chapman and Hall/CRC.

See Also

gcmr

Examples

Run this code
data(polio)
## marginal negative binomial model with ARMA(2,1) errors
m <- gcmr(y~., data=polio, marginal=nb.marg(), cormat=arma.cormat(2,1), 
          options=list(seed=71271, nrep=100))
## randomized quantile residuals
res <- residuals(m)
## normal probability plot
qqnorm(res)
qqline(res)
## autocorrelation plot
acf(res)

Run the code above in your browser using DataLab