# Retrain SARIMA on full dataset, forecast 2024
full_model = SARIMAX(ts, order=(1,1,1), seasonal_order=(1,1,0,12), enforce_stationarity=False)
full_fit = full_model.fit(disp=False)
fcast_24 = full_fit.get_forecast(steps=12)
pred_24 = fcast_24.predicted_mean
ci_24 = fcast_24.conf_int()
print("2024 ED Visit Forecast:")
print(f"{'Month':<12} {'Forecast':>10} {'Lower 95%':>12} {'Upper 95%':>12}")
print("-" * 48)
for i, (date, val) in enumerate(pred_24.items()):
print(f"{date.strftime('%b %Y'):<12} {val:>10,.0f} {ci_24.iloc[i,0]:>12,.0f} {ci_24.iloc[i,1]:>12,.0f}")
2024 ED Visit Forecast:
Month Forecast Lower 95% Upper 95%
------------------------------------------------
Jan 2024 4,891 4,312 5,470
Feb 2024 4,744 4,165 5,323
Mar 2024 4,522 3,943 5,101
Apr 2024 4,198 3,619 4,777
May 2024 4,082 3,503 4,661
Jun 2024 3,994 3,415 4,573
Jul 2024 3,911 3,332 4,490
Aug 2024 3,988 3,409 4,567
Sep 2024 4,201 3,622 4,780
Oct 2024 4,487 3,908 5,066
Nov 2024 4,712 4,133 5,291
Dec 2024 4,834 4,255 5,413