首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ssa()时间序列填充R

ssa()时间序列填充R
EN

Stack Overflow用户
提问于 2017-06-15 01:27:50
回答 0查看 411关注 0票数 1

我有一个关于时间序列的缺口的问题,使用R包{Rssa}。该示例系列的长度为334,并且包含多个NAs。

代码语言:javascript
复制
b1 <- as.vector(B1.med[1,])
> str(b1)
 num [1:334] 0.0171 0.0331 0.014 0.0371 0.0149 0.0179 NA NA 0.0293 0.0096 ...

我想使用igapfill {Rssa}来填充我的NAs。因为igapfill想要一个SSA形状的对象,所以我必须首先做一个ssa,其中出现了一个问题:

代码语言:javascript
复制
> my.L = length(b1)%/%2
> s1.gap <- ssa(b1,L=my.L)
Error in ssa(b1, L = my.L) : 
  Nothing to decompose: the given field shape is empty
In addition: Warning messages:
1: In eval(expr, envir, enclos) :
  Some field elements were not covered by shaped window. 292 elements will be ommited
2: In eval(expr, envir, enclos) :
  Nothing to decompose: the given field shape is empty

帮助建议(默认情况下)窗口长度L大约是数据长度的一半,这对我不起作用。只有在将L设置为23之后,我才不会收到此错误消息,但仍然会出现警告:

代码语言:javascript
复制
> s2.gap <- ssa(b1,L=23)
Warning message:
In eval(expr, envir, enclos) :
  Some field elements were not covered by shaped window. 269 elements will be ommited

> summary(s2.gap) #for L=23

Call:
ssa(x = b1, L = 23)

Series length: 334, Window length: 23,  SVD method: eigen
Special triples:  0

Computed:
Eigenvalues: 1, Eigenvectors: 1,    Factor vectors: 0

Precached: 0 elementary series (0 MiB)

Overall memory consumption (estimate): 0.008934 MiB

但我不会得到超过1个特征向量,直到我进一步减少(仍然是错误消息)。

代码语言:javascript
复制
> summary(s2.gap)  #for L=15

Call:
ssa(x = b1, L = 15)

Series length: 334, Window length: 15,  SVD method: eigen
Special triples:  0

Computed:
Eigenvalues: 15,    Eigenvectors: 15,   Factor vectors: 0

Precached: 0 elementary series (0 MiB)

Overall memory consumption (estimate): 0.01062 MiB

我不太明白我的问题是什么,谷歌等也帮不了我太多忙。我非常感谢您的建议:-)

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44551133

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档