Learn R Programming

gctsc (version 0.1.3)

residuals.gctsc: Compute Randomized Quantile Residuals for Gaussian Copula Time Series

Description

Computes residuals for a fitted gctsc object using randomized quantile residuals.

Usage

# S3 method for gctsc
residuals(object, method = NULL, ...)

Value

A list containing:

residuals

A numeric vector of randomized quantile residuals.

pit

A numeric vector of PIT values.

Arguments

object

A fitted object of class gctsc, produced by gctsc.

method

Can be TMET or GHK

...

Ignored. Included for S3 method compatibility.

References

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

Examples

Run this code
y <- sim_poisson(mu = 5, tau = 0.7, arma_order = c(1, 0), nsim = 100)
fit <- gctsc(y ~ 1, marginal = poisson.marg(), cormat = arma.cormat(1, 0),
             method = "GHK", options = gctsc.opts(seed = 1, M = 1000))
res <- residuals(fit)
hist(res$residuals, main = "Randomized Quantile Residuals", xlab = "Residual")
hist(res$pit, main = "PIT Histogram", xlab = "PIT values")

Run the code above in your browser using DataLab