季节性分解

问题描述 投票:1回答:1

当我使用statsmodels中的季节性分解方法分解时间序列时,我遇到了建模数据的头/尾上缺少值的问题。

这是由于季节性方法默认采用对称移动平均法。

    statsmodels.tsa.seasonal.seasonal_decompose(x, model='additive', filt=None, freq=None, two_sided=True, extrapolate_trend=0)

要解决这个问题,我必须通过一个过滤器,但到目前为止我还不知道哪一个。

谁能帮我吗?在我的数据末尾至少包含值对我来说很重要。

python statsmodels
1个回答
0
投票

阅读the statsmodels documentation

two_sided:过滤时使用的移动平均法。如果为True(默认),则使用filt计算居中移动平均值。如果为False,则滤波器系数仅用于过去值。

“如果为False,则滤波器系数仅用于过去的值”:所以看起来如果您愿意切换到单侧滤波器,您将获得数据末尾的所有值,您认为这是必不可少的。

© www.soinside.com 2019 - 2024. All rights reserved.