# Best regression model for time series data

Suppose I have a Count time series data for the number of tasks that a server gets during a unit of time. Collecting data over a few months, I will get a dataset which will have 2 parameters.

First one will be the number of tasks which will be the dependent variable, and the next one will be the time (adjusted to 0), which will be the independent variable.

Now, as I understand it, the linear regression model cannot be used, as the relation between the number of tasks and time might not be linear. Can someone point out to the proper model for this kind of data?

You don't discuss a couple of key things: how wide your unit of time is (e.g., seconds, minutes, hours, days, etc.) or how many tasks occur per unit of time (e.g., handfuls, hundreds, thousands, etc). This will make a difference in terms of the functional form of the model.

Linear or not, integer counts of tasks as your dependent variable is likely to focus the modeling framework on one of a class of models called limited dependent variable models. These would include data generating processes such as the poisson model, the negative binomial model as well as zero-inflated models. One caveat to these approaches, however, is the question concerning the sheer quantity of tasks per unit of time. If the count of tasks is very large, e.g., hundreds or thousands of tasks, then you might want to consider some type of truncated (at zero) generalized linear (or nonlinear) model -- another flavor of limited DV models.

Let's assume that your event counts aren't huge. This would suggest a poisson process where the probability of an event occurring over some interval of time is proportional to the size of the interval, assuming the events are iid. The overriding assumption of the poisson model is that the variance equal the mean or, alternatively, that the variance is proportional to the mean.

There are a few considerations that can impact the choice of the poisson model: underdispersion (an infrequent result) or overdispersion. Overdispersion occurs when the variance is greater than the mean. There are lots of heuristics for identifying overdispersion in your data, e.g., the ratio of the std deviation to the mean, but formal tests of significance for overdispersion are also available to answer this question: e.g., see http://data.princeton.edu/wws509/notes/c4a.pdf (among others).

Overdispersion in the std errors suggests the negative binomial model which adds a multiplicative random effect θ to the underlying poisson model.

Another consideration involves the frequency with which your data process returns zero tasks or counts for your server per unit of time. If the poisson or negative binomial models are underestimating these zero-event periods, then you may want to shift to one of the zero-inflated approaches in modeling your information.

Classic Box-Jenkins-type approaches to modeling continuously distributed dependent variables would stipulate that the residuals from the model be HAC (heteroscedasticity and auto-correlation consistent). However, B-J models aren't appropriate for count DVs. Rob Hyndman discusses using a gamma function for modeling effects for trends or seasonality with count data here: Time series for count data, with counts < 20

• Thanks a lot for the detailed answer. The material that i have read so far, also lead me to believe that Poisson model is the best for this kind of data. To clear out few things, the unit of time will be seconds, and the number of tasks arriving will be a handfull. The data can be grouped in different groups, but i don't want to make it more complicate then it is. – Haris Oct 25 '15 at 13:04