Recently, I started working on time-series models and would mention that I am very new to python and ML as a whole.

I tried to implement a time-series model on wind speed data. Being a newbie, I followed the steps given in this article: https://kanoki.org/2020/04/30/time-series-analysis-and-forecasting-with-arima-python/ and it's a great one to start with but somehow I am unable to forecast my data (or I would say the forecasted data is constant around the 5.88 value!) enter image description here

forecast,err,ci = results.forecast(steps=n, alpha= 0.05)
windspeed_forecast = pd.DataFrame({'forecast':forecast},index=pd.date_range(start='22/8/2020 01:00:00', periods=n, freq='MS'))

 #plot for forecast
ax = windspeed[19:].SPEED.plot(label='observed', figsize=(20, 15))
ax.fill_between(windspeed_forecast.index, ci[:,0], ci[:,1], color='b', alpha=.005)


-What I think is the high AIC value of 700 might be the problem! enter image description here

-Also, I am unable to figure out how can I create the column of Date-time for the forecasted values same as that of the original data(i.e. hourly based data of a specific date) [As shown in the ss number 1 and as shown in ss below - I need a column starting from 22/8/2020 with hourly gaps and so on].

enter image description here

Also, PFA the ss of my data in jupyter notebook (out of 191 total data, 152 used as train data and rest as test data)

enter image description here

enter image description here Any suggestion/help regarding the same will be appreciated :)

  • $\begingroup$ I don't really understand what your main specific question is here. Can you clarify that (although this is an old question)? $\endgroup$
    – nbro
    Jan 20 at 19:57

First things first, time series is probably the most difficult of all things to predict. If it wasn't I'd be sitting on nice warm beach or on yacht cruising the Mediterranean.

Besides that here's a few hints. First, always visualise your data first. Tables of numbers are fine for computers by the MK1 eyeball is still your best weapon for time series. Is there any obvious trends or seasonal behaviour? If not then ARIMA is unlikely to be of much utility. Secondly, visualise your data after forecasting. Don't just rely on error measures like AIC, use your eyes. Most time series forecasts are useful only in the short term. So you may see the earlier part of your forecast make sense while the latter doesn't.

Finally ARIMA is paramterised by by p, d, and q. The value of d is the minimum number of differencing needed to make the series stationary. If the time series is already stationary, then d = 0. ‘p’ is the order of the ‘Auto Regressive’ (AR) term. It refers to the number of lags of Y to be used as predictors. And ‘q’ is the order of the ‘Moving Average’ (MA) term. It refers to the number of lagged forecast errors that should go into the ARIMA Model.

You have only shown results for p,d,q = 1,0,1. Much of ML is done by trial and error, trying different parameters. So I'd suggest you try varying your values of p, d and q. AIC can then be used to compare models, with smaller values indicating better models.

  • $\begingroup$ Good advice here, in addition, plot the acf (autocorelation function) and show us! Plot the series, show us, remember arma needs stationarity! With hourly data daily seasonality is a possibility ... $\endgroup$ Feb 3 at 1:20

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.