residuals.gctsc: Randomized Quantile Residuals for Copula Count Time Series...

View source: R/residuals.R

residuals.gctscR Documentation

Randomized Quantile Residuals for Copula Count Time Series Models

Description

Computes randomized quantile residuals for a fitted Gaussian or Student–t copula count time series model.

For discrete responses, residuals are constructed using the randomized probability integral transform (PIT) as proposed by Dunn and Smyth (1996). When the likelihood is evaluated via simulation (TMET or GHK), the same engine is used to approximate the required conditional probabilities.

Usage

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

Arguments

object

A fitted model object of class "gctsc", as returned by gctsc.

...

Ignored. Included for S3 method compatibility.

Details

For observation y_t, let F_t(y_t^-) and F_t(y_t) denote the conditional CDF evaluated at y_t - 1 and y_t, respectively. The PIT value is computed as

e_t = F_t(y_t^-) + u_t \{F_t(y_t) - F_t(y_t^-)\},

where u_t \sim \mathrm{Uniform}(0,1).

For Gaussian copulas, residuals are obtained as r_t = \Phi^{-1}(e_t).

For Student–t copulas with degrees of freedom df, the residuals are defined as r_t = t_{\nu}^{-1}(e_t), where t_{\nu}^{-1} denotes the quantile function of the Student–t distribution.

Value

A list of class "gctsc.residuals" containing:

  • residuals: Numeric vector of randomized quantile residuals.

  • pit: Numeric vector of probability integral transform values.

References

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

Nguyen, Q. N., and De Oliveira, V. (2026), Likelihood Inference in Gaussian Copula Models for Count Time Series via Minimax Exponential Tilting, Computational Statistics and Data Analysis.

Nguyen, Q. N., and De Oliveira, V. (2026), Scalable Likelihood Inference for Student–t Copula Count Time Series, Manuscript in preparation.

Examples

# Simulate Poisson AR(1) data under a Gaussian copula
set.seed(1)
y <- sim_poisson(mu = 5, tau = 0.7,
                 arma_order = c(1, 0),
                 nsim = 500,
                 family = "gaussian")$y

fit <- gctsc(
  y ~ 1,
  data = data.frame(y = y),
  marginal = poisson.marg(),
  cormat = arma.cormat(1, 0),
  family = "gaussian",
  method = "CE",
  options = gctsc.opts(seed = 1, M = 1000)
)

res <- residuals(fit)
hist(res$residuals, main = "Randomized Quantile Residuals")
hist(res$pit, main = "PIT Histogram")


gctsc documentation built on March 20, 2026, 9:11 a.m.