stl .series中的错误不是周期性的 [英] error in stl .series is not periodic

查看:322
本文介绍了stl .series中的错误不是周期性的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很确定我错过了一些非常简单的内容,但仍然无法弄清为什么会出现此错误. 我拥有的数据是2013年4月至2014年3月的每个月末数据.现在,我想了解12个月期间的趋势.

I am pretty sure I am missing something which is very simple but still not able to figure out why this error is showing up . The data I have is of every month end data from 2013 Apr to 2014 Mar. Now I want to understand the trend over the 12 months period .

xx <- structure(c(41.52, 41.52, 41.52, 41.68, 41.68, 41.68, 41.84, 
41.84, 41.84, 42.05, 42.05, 42.05), .Tsp = c(2013.25, 2014.16666666667, 
12), class = "ts");

是我的时间序列数据. 现在,当我使用

is my time series data . Now when I use

 stl(xx,s.window ="periodic")

我收到错误消息:

Error in stl(xx, s.window = "periodic") : 
  series is not periodic or has less than two periods

我不确定这是怎么回事,因为我了解该系列有12个句点.请协助

i am not sure what is wrong as I understand the series has 12 periods .Please assist

推荐答案

该术语有点误导.在R中,frequency是一个期间"中的观察次数.对于月度数据,frequency=12并且您只有一个期间.您需要两个周期或24个观测值才能使用stl().

The terminology is a little misleading. In R, the frequency is the number of observations in one "period". For monthly data, frequency=12 and you have just one period. You need two periods, or 24 observations, to use stl().

这篇关于stl .series中的错误不是周期性的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆