0
$\begingroup$

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
n=39
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'))
windspeed_forecast 

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

plt.legend()
plt.show()

-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 :)

$\endgroup$
0
$\begingroup$

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.

| improve this answer | |
$\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.