2
$\begingroup$

I'm trying to model time series data that is bimodal and non-Gaussian. The 2 modes are due to weekday points versus weekend points. I keep thinking that I just need to split the data up to model weekdays separately from weekends but then there are breaks in the time series (i.e. I loose very obvious inter-day trends). Then there are holidays (including the week before and after each holiday) which definitely needs to be treated separately but then again I break up the time series. I'd like to know how outliers/anomalies/weekdays/weekends in a time series should be handled mathematically. Is it best to treat weekends, weekdays, and holidays as 3 different cases or is there another way of dealing with this? Also, what are possible measures of error for non-Gaussian bimodal distributed data?

To add a bit of background as to what I've tried: -ARIMA models (I used the ACF and PACF to determine ARIMA orders) -Multiple linear regression using gradient descent to optimize parameters

What I want to try (feel free to comment about these or add other possible techniques): -wavelet de-noising then neural network model -flexible neural network tree to determine time series model parameters (such as time-lag and input variables)

I'm sorry in advance if I have not been specific enough and unfortunately I can't get too specific as the problem I'm dealing with is confidential. But any advice regarding the issues I've explained will be much appreciated. Also, if anyone knows of books pertaining to contemporary methods of modeling time series, that would be great as well. Thank you!

$\endgroup$
1
$\begingroup$

If there's an unvarying within-week pattern as well, you might look at some sort of fixed seasonal factor (a day-of-week factor) in addition to the ARIMA model. Some packages will allow the addition of regression-type predictors to an ARIMA model.

If it's constant for weekdays and different for weekends (which are similar to each other) a single 'weekend' factor would take care of that.

However, such patterns often evolve over time; you might want to consider models that can deal with evolving effects of that form, such as Harvey's basic structural model.


A few questions - does the distribution not matter then?

The conditional distribution certainly matters. The marginal distribution of data that doesn't have constant mean may not mean so much (except in rather limited circumstances).

Also, when you say weekend factor and seasonal factor, how exactly would I calculate what these factors should be?

By including them in a model, but there's several ways that might be done.

For example, in R, one way to fit a weekend effect would be to have a 'weekend' indicator (0 for a weekday, 1 for a weekend-day) for each observation and supply that to the xreg argument of the arima function.

e.g. for this data:

enter image description here

(where $x$ in the plot represents the weekend variable), I did this:

> arima(y,order=c(2,0,0),xreg=weekend)

Call:
arima(x = y, order = c(2, 0, 0), xreg = weekend)

Coefficients:
         ar1      ar2  intercept   weekend
      0.3091  -0.2157    80.8207  -31.0250
s.e.  0.0869   0.0855     1.0812    2.1326

sigma^2 estimated as 86.99:  log likelihood = -485.77,  aic = 981.54

And, as you see, it has fitted an AR(2) model, with an intercept and a term for the 'weekend' effect.

Many packages can do something similar.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ First, thanks for your answer. A few questions - does the distribution not matter then? Also, when you say weekend factor and seasonal factor, how exactly would I calculate what these factors should be? Does that make sense? I mean I know when I calculate the parameters for an ARIMA model, I'm minimizing an error function. Are you saying just add on another term which is then used in an algorithm to minimize error or is there actually an option in ARIMA such that I can capture the weekend trend? $\endgroup$ – eTothEipiPlus1 Sep 4 '14 at 12:29
  • $\begingroup$ I've responded in my answer, and made some further additions of the kind of thing I meant. (In other circumstances I might consider seasonal differencing.) $\endgroup$ – Glen_b Sep 4 '14 at 21:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.