I'm trying to use decomposition to forecast into the future. From my reading I understand that I can do this by adding a trend formula to a seasonality formula. I know that I can decompose a time series with this:
import statsmodels.api as sm
result = sm.tsa.seasonal_decompose(series.values, model='additive',freq=12)
trend = result.trend
seasonal = result.seasonal
residual = result.resid
The trend
, seasonal
and residual
variables are arrays of numbers. I've searched google and the documentation for seasonal_decompose
and haven't found a way to see/get access to the formulas used to calculate the numbers for trend
and seasonal
.
From my understanding, I need those formulas in order to be able to make projections. Do you know of a way to get those formulas from seasonal_decompose
? Is there another function or method that works better for this?