0

我正在对训练数据的最后 90 天条目进行预测。但是,我的置信区间范围很广。我想知道我是否正确计算了 CI?

log_return = np.log(rolling_mean_truncate/rolling_mean_truncate.shift(1)).dropna()

model = SARIMAX(log_return, order=(5,0,1))
results = model.fit()
one_step_forecast = results.get_prediction(start=-90)

# Extract prediction mean
mean_forecast = one_step_forecast.predicted_mean
predicted = np.exp(mean_forecast.cumsum())*rolling_mean_truncate.iloc[-90]
confidence_intervals = one_step_forecast.conf_int(0.1)

lower_limits = confidence_intervals.loc[:,'lower Close']
lower_predicted = np.exp(lower_limits.cumsum())*rolling_mean_truncate.iloc[-90]
upper_limits = confidence_intervals.loc[:,'upper Close']
upper_predicted = np.exp(upper_limits.cumsum())*rolling_mean_truncate.iloc[-90]

谢谢!

4

0 回答 0