各位好,
最近在研究时间序列模型,
主要是用SARIMAX、Prophet跟LSTM,
前两个统计模型都知道怎做未来多期预测跟信赖区间,
例如,
SARIMAX预测未来10期之68%信赖区间:
model = SARIMAX(df.ln_price, order=(2,1,1))
result = model.fit()
forecast = result.get_forecast(steps=10)
conf = forecast.conf_int(alpha=0.32)
Prophet预测未来10期之68%信赖区间:
m = Prophet(interval_width=0.68)
m.fit(df[['ds', 'y']])
future = m.make_future_dataframe(periods=10, include_history=False)
fcst = m.predict(future)
但keras LSTM要怎做未来多期预测跟信赖区间呀?
model = Sequential()
model.add(LSTM(10, input_shape=(1, 3))) # 10 lstm neuron
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer='adam')
model.fit(trainX, trainY, epochs=50, batch_size=1)
接下来要怎做未来10期的预测就不会了... 信赖区间也不知道可以怎么用出来。
麻烦大家给点方向了,谢谢。