# How to forecast traffic data with ARIMA?

I have traffic data from cars on a roadside view for 3 weeks Each line of data sets consists of Day, Time, and Track number of cars for 3 weeks. I want to make a forecast for the 4th week using these data and using the ARIMA model

Here is an example of my data

Time          Data
2008-05-19-00 110
2008-05-19-01 25
2008-05-19-02 900
2008-05-19-03 434
2008-05-19-04 50
....


Until 2008-06-08

How do I make a forecast of the 4th week (from 9/06 to 15/06)?

• Who can help me please? – Rami Apr 22 '17 at 12:47

Here, you can use this cheat sheet for ARIMA.(https://www.datascience.com/blog/introduction-to-forecasting-with-arima-in-r-learn-data-science-tutorials)

Plot the data and examine its patterns and irregularities.

Clean up any outliers or missing values if needed. tsclean() is a convenient method for outlier removal and inputing missing values.

Take a logarithm of a series to help stabilize a strong growth trend.

Does the series appear to have trends or seasonality?

Use decompose() or stl() to examine and possibly remove components of the series.

1. Stationarity

Is the series stationary?

Use adf.test(), ACF, PACF plots to determine order of differencing needed.

1. Autocorrelations and choosing model order

Choose order of the ARIMA by examining ACF and PACF plots

1. Fit an ARIMA model
2. Evaluate and iterate

Check residuals, which should haven no patterns and be normally distributed If there are visible patterns or bias, plot ACF/PACF. Are any additional order parameters needed? Refit model if needed. Compare model errors and fit criteria such as AIC or BIC. Calculate forecast using the chosen model.

As the others mentioned, you can use "forecast" package after your model is built.

You can make use of the "forecast" package in R. However, you will have to fita model before doing that.

example code:

model <- auto.arima(Data)
forecast(model)
plot(forecast(model))

• I do not need to introduce some parameters, that is to say is all pass automatically? – Rami Apr 22 '17 at 13:33
• You can't forecast without modelling first. Otherwise your predictions will be random. the auto.arima function fits an ARIMA model automatically. You can then take a look using the summary() function – Vasilis Vasileiou Apr 22 '17 at 13:36