1
$\begingroup$

The data consists of a time series with daily frequency. It is basically temperature data, and I can see a clear seasonal pattern throughout the year.

I would like to model this time series using statsmodels SARIMAX method. Since I have daily data and a yearly seasonal pattern, I chose s=365 in the seasonal order parameter. Now my understanding of the other seasonality parameters is as follows: In (P,D,Q,s) I first determined s as before. Then, since s is positive, I chose P=1 and Q=0. My time series is stationary, so I chose D=0. This leads to the following code:

order = (3,0,1)
seasonal_order = (1,1,0,365)

model = sm.tsa.statespace.SARIMAX(
    endog=NG_train,
    exog=HDD_train,
    order=order,
    seasonal_order=seasonal_order,
    time_varying_regression=True,
    mle_regression=False,
    measurement_error=True,
)

Now this causes two problems: First of all, the method takes way too long to calculate, and I don't get any results. Second of all, if I would get results I suspect my model would be heavily overfitted, as to my understanding this adds 364 extra parameters to it. I am struggling with the method's documentation, hence why I am asking my question here. Is there any way to overcome this problem? I would be happy to include monthly seasonality, however simply setting s=12 doesn't work, and I don't want to aggregate my data to monthly data.

$\endgroup$
7
  • 1
    $\begingroup$ Do not use SARIMA(X) with very long seasonal periods: robjhyndman.com/hyndsight/longseasonality Use Fourier terms or other alternatives instead. $\endgroup$ Apr 21, 2023 at 11:30
  • $\begingroup$ @RichardHardy: do you want to post your comment(s) as an answer? Better to have a short answer than no answer at all. Anyone who has a better answer can post it. $\endgroup$ Apr 21, 2023 at 11:38
  • $\begingroup$ @StephanKolassa, this is a duplicate, so there is no point in answering it. But I did not have the time to look for the relevant thread to close this one against, so I just posted a comment... $\endgroup$ Apr 21, 2023 at 12:08
  • $\begingroup$ @RichardHardy: I did look and did not find anything I could close this as a duplicate of. This search does turn up a number of "near duplicates". $\endgroup$ Apr 21, 2023 at 12:18
  • 1
    $\begingroup$ @user21551428, the problem with long seasonal periods for SARIMA is more fundamental than a specific implementation such as R or Python. It will pop up regardless of what software you use. $\endgroup$ Apr 21, 2023 at 12:42

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.