Using SARIMAX for daily data with yearly seasonal pattern

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.

• Do not use SARIMA(X) with very long seasonal periods: robjhyndman.com/hyndsight/longseasonality Use Fourier terms or other alternatives instead. Apr 21, 2023 at 11:30
• @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. Apr 21, 2023 at 11:38
• @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... Apr 21, 2023 at 12:08
• @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". Apr 21, 2023 at 12:18
• @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. Apr 21, 2023 at 12:42