natnay
natnay

Reputation: 490

SARIMAX - Unexpected Forecast Results

I'm trying to forecast some measure of weight using SARIMAX. The model fits the data quite well, but when it comes to forecasting it's not doing what I expected. In the image below you can see my data has a seasonal component right around December. But when I forecast into December the line remains flat. I guess I expected it to model this trend as I added a season component. Is this expectation incorrect or am I doing something wrong? My code is below the image. Thanks for your help!

enter image description here

# Model
model = SARIMAX(sum_all_model,order=(0,1,2),seasonal_order=(2,0,2,12))
results = model.fit()
# Forecasting
forecast = results.forecast(100)

Upvotes: 1

Views: 1847

Answers (1)

cfulton
cfulton

Reputation: 3195

One issue is that the last argument of the seasonal_period gives the number of periods in a season, and this is relative to the frequency of the input data.

It looks like your input data is maybe daily, so by setting the seasonal period to 12, you're saying that the season repeats every 12 days, not every 12 months.

Two notes:

  1. It looks like the mean of your process changes in December, and that would not be captured by an SARIMAX model, even if you had the correct seasonal period.
  2. The SARIMAX model is not computationally efficient for large seasonal periods (in fact it is often very slow / memory intensive), so I would not recommend trying to remedy this with an annual seasonal period on daily data.

Upvotes: 2

Related Questions