I tried using ARIMA method to forecast yearly Wind speed data, using Diky fuller test P-value is below 0.05 hence I use the original data instead of differential. The data amounts 730, 2 sets of data for 1 day.
from statsmodels.tsa.arima_model import ARIMA
# 1,0,2 ARIMA Model
model = ARIMA(df, order=(1,0,2))
model_fit = model.fit(disp=0)
print(model_fit.summary())
This code gives me MA.L2.wind_speed: coeff= 0.1657, std error= 0.042, P>|z|=0
So I think I am good with this p, d and q value
model_fit.plot_predict(dynamic=False)
plt.show()
The actual vs fitting data does not look bad, but the issue comes from Out-of-time Validation graph
It looks too much different with the actual data. I use this code to for the forecast.
train = df[:620]
test = df[620:]
# Build Model
# model = ARIMA(train, order=(3,2,1))
model = ARIMA(train, order=(1, 0, 2))
fitted = model.fit(disp=-1)
# Forecast
fc, se, conf = fitted.forecast(110, alpha=0.05) # 95% conf
# Make as pandas series
fc_series = pd.Series(fc, index=test.index)
lower_series = pd.Series(conf[:, 0], index=test.index)
upper_series = pd.Series(conf[:, 1], index=test.index)
What should I do to fix the forecast?
EDIT: Below is the picture of ACF and PCF I used to decide P and Q Value
P comes from Partial correlation that while I could not see the significance line, lag 1 has shown to be above it and safe enough to be used, CMIIW.
Q uses Auto correlation, I simply chose 2 because there are several lags above the line, so if 2 does not give good error I would change it into other numbers.
The Estimates from ARMA models are as follow: constant = 3.8709
ar.L1.wind_speed = 0.5320
ma.L1.wind_speed = -0.2129
auto.arima()
in theforecast
package for R. $\endgroup$