简体   繁体   English

R 去除一个时间序列中的多个季节性

[英]R Remove multiple seasonality in one time series

I'm dealing with hourly data and my data has 24 hours & 168 hours seasonality.我正在处理每小时数据,我的数据有 24 小时和 168 小时的季节性。

When I use that code.当我使用该代码时。 I removed 24 hours seasonality.我删除了 24 小时季节性。

deseasonalized_ec_hourly<-electricity_consumption_ts_hourly/ec_hourly_multip$seasonal

But 168 hours seasonality remains.但是 168 小时的季节性仍然存在。 How can I remove 168 hours seasonality如何删除 168 小时季节性

Here's an example using half-hourly electricity consumption from England and Wals (June - August 2000).这是一个使用英格兰和沃尔斯(2000 年 6 月 - 8 月)半小时用电量的示例。 The seasonality (daily and weekly) is estimated using the mstl() function from the forecast package.使用来自forecast package 的mstl() function 估计季节性(每天和每周)。 The seasadj() function removes the seasonal components. seasadj() function 删除了季节性成分。

library(forecast)

autoplot(taylor)

adjust <- taylor %>% mstl() %>% seasadj()
autoplot(adjust)

Created on 2020-05-07 by the reprex package (v0.3.0)代表 package (v0.3.0) 于 2020 年 5 月 7 日创建

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM