plot.gctsc: Diagnostic Plots for Fitted Copula Count Time Series Models

View source: R/residuals.R

plot.gctscR Documentation

Diagnostic Plots for Fitted Copula Count Time Series Models

Description

Produces diagnostic plots for a fitted Gaussian or Student–t copula count time series model of class "gctsc".

The diagnostics are based on randomized quantile residuals and probability integral transform (PIT) values.

Usage

## S3 method for class 'gctsc'
plot(
  x,
  caption = rep("", 5),
  main = rep("", 5),
  level = 0.95,
  col.lines = "gray",
  ...
)

Arguments

x

A fitted model object of class "gctsc".

caption

Optional character vector of length 5 providing captions for the plots.

main

Optional main titles for the plots.

level

Confidence level for the Q–Q envelope (default 0.95).

col.lines

Color used for reference lines.

...

Additional graphical arguments passed to plotting functions.

Details

The following diagnostic plots are produced:

  1. Time series of randomized quantile residuals.

  2. Q–Q plot against the reference distribution.

  3. Histogram of PIT values.

  4. Autocorrelation function (ACF) of residuals.

  5. Partial autocorrelation function (PACF) of residuals.

For Gaussian copulas, residuals are compared against the standard normal distribution. For Student–t copulas, residuals are compared against a Student–t distribution with degrees of freedom obtained from fitted model.

Value

Invisibly returns NULL.

This function is called for its side effects and returns invisible().

See Also

residuals.gctsc

residuals.gctsc for computing the residuals used in the plots.

Examples

# Simulate data from a Poisson AR(1) model
set.seed(123)
n <- 2000
mu <- 5
phi <- 0.5
arma_order <- c(1, 0)
y <- sim_poisson(mu = mu, tau = phi, arma_order = arma_order, nsim = n)$y

# Fit the model using the CE method
fit <- gctsc(y~1,
  marginal = poisson.marg(link = "identity", lambda.lower = 0),
  cormat = arma.cormat(p = 1, q = 0), family ="gaussian",
  method = "CE",
  options = gctsc.opts(seed = 1, M = 1000),
  c = 0.5
)

# Produce diagnostic plots
par(mfrow = c(2, 3))
plot(fit)

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