2
$\begingroup$

I am learning on how to predict with ARIMA models. To get some knowledge I read trough some online tutorials for R and ARIMA models.

Now I wanted to try this by myself with a problem I am currently working on. The goal is to predict the vehicle speed of a car based on past measures. I have data sampled from the vehicle CAN-Bus with a rate of 0.01s. For me it doesn't matter if I predict the speed or the acceleration of the car.

First I make my data a time series with:

    data<-ts(data[,2],start = c(0,1),frequency = 100)

ACF and PACF return following results (data = vehicle speed)

Speed, Acceleration, ACF and PACF

I am not sure how to proceed further from here, hope someone can help me on what to perform on my data to use the auto.arima function

EDIT:

for explanatian, when I run ARIMAfit<-auto.arima(ts(data)) I get the following:

    Series: ts(data) 
    ARIMA(1,1,0)                    

    Coefficients:
            ar1
            0.9893
            s.e.  0.0008

    sigma^2 estimated as 1.05e-06:  log likelihood=183883.2
    AIC=-367762.3   AICc=-367762.3   BIC=-367745.5

    Training set error measures:
            ME        RMSE        MAE MPE MAPE      MASE       ACF1
    Training set -1.988926e-07 0.001024627 0.00067539 NaN  Inf 0.1398728 -0.2072756

with pred<-predict(ARIMAfit,n.ahead=1000) the prediction is almost zero for the next 1000 points

$\endgroup$
5
  • $\begingroup$ and what seems the problem ? I see that the speed towards end of your time series is practically zero, then why should the prediction not be close to zero too ? seems perfectly legit to me. $\endgroup$ Commented Feb 21, 2017 at 21:17
  • $\begingroup$ well I doubt, that a good prediction would assume, that my car will stand still for the next 1000 seconds.... I also tried different prediction horizons and all return a value near 0 $\endgroup$
    – Caligula
    Commented Feb 22, 2017 at 7:56
  • $\begingroup$ maybe it will stand still, maybe not, who knows ? but its standing right now. therefore the prediction that it will keep standing is very good one. therefore, in my personal opinion there is no problem here to be solved. $\endgroup$ Commented Feb 22, 2017 at 8:54
  • $\begingroup$ Just tried it with the dataset reaching only from 0 to 270s (near the peak) and it's zero too, so I guess there is a problem to be solved; maybe someone could tell me, if in repesctive to ACF and PACF my data is stationary (enough?) for an arima operation or if any differentiation or integration should be performed $\endgroup$
    – Caligula
    Commented Feb 22, 2017 at 9:50
  • $\begingroup$ the prediction of ARIMA should usually start around the level where the historical data ends. if it is still 0 in your case, there must be some programming error, because if you cut your series around 270 data point, then indeed the start of forecasts should be around 30-60km/h. you should double-check debug your code I suggest $\endgroup$ Commented Feb 22, 2017 at 10:05

1 Answer 1

0
$\begingroup$

I worked with this link (but it works with python, hope it's ok) .

I'll just explain the flow quickly:

  1. extract the order of ma coefficients with ACF (as in the link)
  2. same with order of ar just with partial ACF
  3. Now use the arma.fit to get the coefficients and innovation noise variance
$\endgroup$
6
  • $\begingroup$ my main problem is, that in respective to my ACF and PACF-plots I have enough spikes outside of the insignificatn zone, but when run my auto.arima(data)-command to find the most suitable parameters I am not getting any result $\endgroup$
    – Caligula
    Commented Feb 21, 2017 at 13:12
  • $\begingroup$ @Caligula, it is because auto.arima does not look at ACF or PACF but rather at information criteria (by default AICc, but optionally AIC or BIC). $\endgroup$ Commented Feb 21, 2017 at 15:12
  • $\begingroup$ @Richard, I am currently on the go and will have a look into the documentation later, like I said I started to learn it a few days ago ;) could you give me a hint on what to use? The normal arima command? And what would be the best way to determine the p and q values since my AIC has a lot of spikes? $\endgroup$
    – Caligula
    Commented Feb 21, 2017 at 16:39
  • 1
    $\begingroup$ @Caligula, auto.arima is not a stupid algorithm and it uses AICc-based selection for a reason (AICc aims at finding a model that forecasts best, while ACF- and PACF-based selection aims at finding the true model; the two are in general not the same). I would go for auto.arima. You need considerable experience in time series forecasting to beat that algorithm. $\endgroup$ Commented Feb 21, 2017 at 16:42
  • $\begingroup$ @Richard so based on your expierence, what would your next steps be to solve the problem, any good literature where I can look it up? $\endgroup$
    – Caligula
    Commented Feb 22, 2017 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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