acp {acp}R Documentation

Autoregressive Conditional Poisson (ACP) Regression

Description

Fit an ACP(p,q) regression model.

Usage

acp(x, ...)
## Default S3 method:
acp(x, y, p, q ,startval, varopt,...)
## S3 method for class 'formula'
acp(formula, data=list(), p, q ,startval=NULL, varopt=T, family="acp",...)
## S3 method for class 'acp'
print(x, ...)
## S3 method for class 'acp'
summary(object, ...)
## S3 method for class 'acp'
predict(object, newydata=NULL, newxdata=NULL,...)

Arguments

x

a numeric design matrix for the model.

y

a numeric vector of responses.

p

number of lags for the dependent variable.

q

number of lags for the conditional mean.

startval

a numeric vector of starting values. If not provided the package will obtain starting values for the covariate parameters from a poisson regression and for the autoregressive parameters from an arma(1,1) regression.

family

A description of the specification to be used. If family="acp" or not provided an Autoregressive Poisson regression will be estimated whereas if family="poisson" a plain Poisson regression is provided.

formula

a symbolic description of the model to be fit.

data

an optional data frame containing the variables in the model.

varopt

an optional logical operator T (TRUE) or F (FALSE) determining whether the covariance matrix will be calculated (T) or not (F).

object

an object of class "acp", i.e., a fitted model.

newxdata

a data frame containing the covariates data upon which a static forecast will be performed.

newydata

a data frame containing the dependent variable upon which a static forecast will be performed.

...

not used.

Details

This model has been proposed by Heinen (2003) for cases of count data exhibiting autoregressive behaviour. As pointed by Cameron and Trivedi (1998), when a count data set exhibits time dependence the plain Poisson regression is not adequate. Heinen (2003) proposed the ACP model in close analogy to the Autoregressive Conditional Duration model (ACD) of Engle and Russel (1998) and the GARCH model of Bollerslev (1986). The model can be also found in the international bibliography as Integer GARCH (Fokianos and Fried, 2010).

Value

An object of class logreg, basically a list including elements

coefficients

a named vector of coefficients

vcov

covariance matrix of coefficients

fitted.values

fitted values

residuals

residuals

logl

log-likelihood

AIC

AKAIKE information criterion

BIC

Bayesian information criterion

Author(s)

Siakoulis Vasileios

References

Examples


data(polio)

trend=(1:168/168)
cos12=cos((2*pi*(1:168))/12)
sin12=sin((2*pi*(1:168))/12)
cos6=cos((2*pi*(1:168))/6)
sin6=sin((2*pi*(1:168))/6)


#Autoregressive Conditional Poisson Model with explaning covariates
polio_data<-data.frame(polio, trend , cos12, sin12, cos6, sin6)
mod1 <- acp(polio~-1+trend+cos12+sin12+cos6+sin6,data=polio_data, p = 1 ,q = 2)
summary(mod1)

#Static out-of-sample fit example
train<-data.frame(polio_data[c(1: 119),])
mod1t <- acp(polio~-1+trend+cos12+sin12+cos6+sin6,data=train, p = 1  ,q = 2)
xpolio_data<-data.frame(trend , cos12, sin12, cos6, sin6)
test<-xpolio_data[c(120:nrow(xpolio_data)),]
yfor<-polio_data[120:nrow(polio_data),1]
predict(mod1t,yfor,test)

#Autoregressive Conditional Poisson Model without explaning covariates
polio_data<-data.frame(polio)
mod2 <- acp(polio~-1,data=polio_data, p = 3 ,q = 1)
summary(mod2)

#Poisson Model with explaning covariates
polio_data<-data.frame(polio, trend , cos12, sin12, cos6, sin6)
mod3 <- acp(polio~trend+cos12+sin12+cos6+sin6,data=polio_data,family="poisson")
summary(mod3)

#Default method for ACP regression
X<-cbind(trend , cos12, sin12, cos6, sin6)
mod4<-acp(X,polio,3,1,startval=NULL,varopt=TRUE)
print(mod4)
summary(mod4)
residuals(mod4)
mod4$vcov
mod4$AIC
mod4$BIC

[Package acp version 2.1 Index]