且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将每小时的动物园时间序列输入函数 stl()

更新时间:2023-02-26 19:24:01

使用一个完整周期为 1 的时间表示,因此对于频率为 24 的每小时数据,一个时间单位应对应于一天.chron 就是这样工作的:

Use a time representation for which is a full cycle is 1 so for hourly data with a frequency of 24 a unit of time should correspond to a day. chron works that way so:

library(zoo)
library(chron)

z <- read.zoo(text = texinp, header = TRUE, sep = ",", FUN = as.chron)
stl(z, "per")