gpt4 book ai didi

python - 季节分解

转载 作者:太空宇宙 更新时间:2023-11-03 21:06:44 24 4
gpt4 key购买 nike

当我使用 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,则滤波器系数仅适用于过去的值”:因此,如果您愿意切换到单侧滤波器,您将在最后获得所有值您的数据,您认为这是必不可少的。

关于python - 季节分解,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55348238/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com