当我使用 statsmodels 中的季节性分解方法分解时间序列时,我遇到了建模数据的头部/尾部缺少值的问题。
这是由于季节性方法默认采用对称移动平均法所致。
statsmodels.tsa.seasonal.seasonal_decompose(x, model='additive', filt=None, freq=None, two_sided=True, extrapolate_trend=0)
为了解决这个问题,我必须通过一个过滤器,但到目前为止我不知道是哪一个。
谁能帮帮我吗?对我来说,数据末尾至少有值很重要。
阅读the statsmodels documentation :
two_sided: The moving average method used in filtering. If True (default), a centered moving average is computed using the filt. If False, the filter coefficients are for past values only.
“如果为 False,则滤波器系数仅适用于过去的值”:因此,如果您愿意切换到单侧滤波器,您将在最后获得所有值您的数据,您认为这是必不可少的。
我是一名优秀的程序员,十分优秀!