我有一个关于时间序列的缺口的问题,使用R包{Rssa}。该示例系列的长度为334,并且包含多个NAs。
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,其中出现了一个问题:
> 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之后,我才不会收到此错误消息,但仍然会出现警告:
> 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个特征向量,直到我进一步减少(仍然是错误消息)。
> 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我不太明白我的问题是什么,谷歌等也帮不了我太多忙。我非常感谢您的建议:-)
https://stackoverflow.com/questions/44551133
复制相似问题