On the section "STL decomposition" in the 2nd edition of Forecasting: Principles and Practice, it says that the seasadj()
function can be used to compute the seasonally adjusted series but it does not say how this seasonally adjusted series is computed. I'm wondering how to do this in python's statsmodel package as there is no such seasadj
function.
If I have an STL decomposition like so:
would the seasonally adjusted series be the trend + remainder
? Just the trend
?
In python:
from statsmodels.tsa.seasonal import STL
stl_decomp = STL(series, period=12, seasonal=7).fit()
stl_seas_adj = stl_decomp.trend + stl_decomp.resid
Is this the correct way to compute the seasonally adjusted data?