“ NA”导致R中附加时间序列的分解 [英] "NA" results in Decomposition of Additive Time Series in R

查看:244
本文介绍了“ NA”导致R中附加时间序列的分解的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解我的附加时间序列的分解图。这是我的代码:

I'm trying to understand my "decomposition of additive time series" graph. Here's my code:

dbs_discs <- ts(RC$Disconnects, frequency =12, start=c(2013,1))
discs_dbs <- decompose(dbs_discs)
plot(discs_dbs)
discs_dbs

和我的结果:

$trend
          Jan      Feb      Mar      Apr      May      Jun      Jul      Aug      Sep      Oct      Nov      Dec
2013       NA       NA       NA       NA       NA       NA 301.8891 302.4746 302.6317 303.1842 304.2663 304.2212
2014 304.6779 306.3847 309.0182 310.5303 309.9420 309.1160 307.1276 304.2277 302.4454 301.2108 300.1494 299.7908
2015 299.5936 299.2328 298.4888 297.8479 297.3363 296.2674       NA       NA       NA       NA       NA       NA  

结果,我的趋势图显示到2013年年中之前都没有绘制任何图。显示NA?这是什么意思?为什么没有值?

As a result, my trend graph shows nothing plotted until mid 2013. Is there a reason why it's showing NA? What does it mean? Why would there be no values?

谢谢!

推荐答案

它似乎分解函数使用12个月的2次移动平均线来确定该系列的趋势成分。 (请参见?filter 以及分解下面的代码)。也就是说,2013年7月的趋势值将是前六个月和之后六个月(包括之后)的移动平均值。

It seems the decompose function uses a 12-month 2-way moving average to determine the trend component of the series. (See ?filter and the code underneath decompose). That is, the trend value in July 2013 will be the moving average for the 6 months before and 6 months after (inclusive).

如果要执行趋势周期分解,但不想减少端点,也许值得看一下 mFilter 包,该包实现了多个过滤器。请注意,基本上在所有趋势周期分解中都存在端点问题(即,误认为趋势和周期),因此买家要当心。

If you want to perform trend-cycle decomposition but don't want to trim off your end-points, perhaps it's worth looking at the mFilter package, which implements several filters. Note that in basically all trend-cycle decompositions there are end-point issues (ie. mistaking trend and cycle), so buyer beware.

这篇关于“ NA”导致R中附加时间序列的分解的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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