11
$\begingroup$

I have a binary time series with 1 when the car is not moving, and 0 when the car is moving. I want to make a forecast for a time horizon up to 36 hours ahead and for each hour.

My first approach was to use a Naive Bayes using the following inputs: t-24 (daily seasonal), t-48 (weekly seasonal), hour of the day. However, the results are not very good.

Which articles or software do you recommend for this problem?

$\endgroup$
  • $\begingroup$ see if this helps math.bme.hu/~morvai/publications/papers/… good day $\endgroup$ – Mithun Ashok Sep 2 '11 at 3:22
  • $\begingroup$ Have you considered a hidden markov model? $\endgroup$ – Ram Ahluwalia Sep 2 '11 at 3:25
  • $\begingroup$ Thanks for the answers. But there is any software package already available with some implementations? I have searched in R, but I only found the VLMC package. Thanks, Ricardo Bessa $\endgroup$ – user6145 Sep 2 '11 at 18:17
  • $\begingroup$ Ricardo, you should edit your question with this additional information instead of adding it as an answer. Thanks, and welcome to the site! $\endgroup$ – Aaron Sep 2 '11 at 18:26
  • $\begingroup$ Are there really two types of 1's in your data? That is, 1 meaning the car could be moving but is not versus 1 meaning that your car really could not be moving at this time. That would be called one-inflation (it's usually zero-inflation). If so, you need to model when the car can be moving or not versus when it might be moving but is not. $\endgroup$ – Wayne Sep 2 '11 at 19:13
6
$\begingroup$

You can use generalized ARMA (GLARMA) models. See, for example, Kedem and Fokianos (2002), Regression Models for Time Series Analysis.

See also R package glarma (on CRAN)

$\endgroup$
  • $\begingroup$ This answer should not have been downvoted. $\endgroup$ – usεr11852 Dec 16 '15 at 21:10
3
$\begingroup$

The R package bsts allows you to estimate Bayesian structural time series models with binary targets by setting family = 'logit'. Note, though, that these models often require longer runs than Gaussian data (e.g., niter = 10000).

$\endgroup$
2
$\begingroup$

How about using logistic regression with some time lags (daily, weekly) as predictors? (most statistical software packages have logistic regression). It's a bit of shooting in the dark -- can you share the data or a plot?

$\endgroup$
2
$\begingroup$

The Hidden markov model is the sequential version of Naive Bayes. In naive bayes, you have a label with several possible values (in your case 0/1) and a set of features. The value for y is selected by modeling p(features | label) * p(label).

In a hidden markov model, a sequence of labels is predicted by modeling p(label | previous label) and P(features | label).

$\endgroup$

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.