【问题标题】:Time Series for Periods Over One Year一年以上期间的时间序列
【发布时间】:2015-01-23 16:41:03
【问题描述】:

我在为我的数据集做时间序列时遇到了麻烦。大多数示例都有季度或月度频率,但我的问题来自每年或每两年收集的数据。考虑我的代码:

data<-data.frame(year=seq(1978,2012,2), number=runif(18,100,500))
time<-ts(data$number, start=1978, frequency=.5)
decomp<-decompose(time)
Error in decompose(time) : time series has no or less than 2 periods

如何让 R 从每年收集的数据中识别时间序列值?谢谢!

【问题讨论】:

    标签: r time-series


    【解决方案1】:

    季节分解只对年度内的数据有意义,因为您在年份中有季节。因此,尝试使用decompose 对每两年收集的数据计算季节性影响会出现错误。

    【讨论】:

    • 有解决办法吗?我应该错误地分类要在一年中收集的时间序列吗?
    • 我认为您需要一些循环模型而不是季节性模型。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多