| plot.gctsc | R Documentation |
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.
## S3 method for class 'gctsc'
plot(
x,
caption = rep("", 5),
main = rep("", 5),
level = 0.95,
col.lines = "gray",
...
)
x |
A fitted model object of class |
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. |
The following diagnostic plots are produced:
Time series of randomized quantile residuals.
Q–Q plot against the reference distribution.
Histogram of PIT values.
Autocorrelation function (ACF) of residuals.
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.
Invisibly returns NULL.
This function is called for its side effects and returns invisible().
residuals.gctsc
residuals.gctsc for computing the residuals used in the plots.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.