hello, I try to model traffic accidents with the following model: glm.nb(y~j+w+m+sf+b+ft,data=fr[]). the problem is that there exist autocorrelation in the data. one possibility is to model traffic accidents with inar(1)-models. has anyone an idea how to change this model in order to abtain an integer valued time series model? thanks nazli
see onlinelibrary.wiley.com/doi/10.1111/j.1467-9892.2010.00684.x/abstract kjetil On Fri, Nov 19, 2010 at 6:02 PM, <sahin at hsu-hh.de> wrote:> hello, > > I try to model traffic accidents with the following model: > > glm.nb(y~j+w+m+sf+b+ft,data=fr[]). the problem is that there exist > autocorrelation ?in the data. one possibility is to model traffic accidents > with inar(1)-models. has anyone an idea how to change this model in order to > abtain an integer valued time series model? > > thanks > nazli > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
You can fit this model with AD Model Builder's random effects module. there is an example fitting a Poisson and negative binomial to the venerable polio data set with ar(1) random effects at admb-project.org/examples/count-data/negative-binomial-serially-correlated-counts A big advantage of ADMB is flexible modeling of both the mean and overdispersion.