# 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),
method = "CE",
options = gctsc.opts(seed = 1, M = 1000),
c = 0.5
)
# Produce diagnostic plots
plot(fit)
Run the code above in your browser using DataLab