Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R STLM中的模型函数_R_Forecast - Fatal编程技术网

R STLM中的模型函数

R STLM中的模型函数,r,forecast,R,Forecast,您好,我想使用nnfor包中的elm函数,在季节性调整的时间序列上,从forecast包中计算STLM模型 我可以使用thenmodelfunction参数来实现这一点 让我们用这个时间系列: y<- ts(rnorm(300,mean=0,sd=1), start=c(2012,2), frequency=12) > head(y,10) Feb Mar Apr May Jun 2012

您好,我想使用
nnfor
包中的
elm
函数,在季节性调整的时间序列上,从
forecast
包中计算
STLM
模型

我可以使用then
modelfunction
参数来实现这一点

让我们用这个时间系列:

y<- ts(rnorm(300,mean=0,sd=1), start=c(2012,2), frequency=12)

> head(y,10)
             Feb         Mar         Apr         May         Jun
2012  1.83672399  0.09163453  1.43897758 -0.06213232  0.21279124
             Jul         Aug         Sep         Oct         Nov
2012  1.43642897  1.36854342 -0.38119914 -0.94666416  1.41982674
但不是来自其他软件包的预测模型

model2 =stlm(y,modelfunction=nnfor::elm)

> Error in `+.default`(fitted(fit), allseas) : 
  time-series/vector length mismatch
modelfunction参数应该使用哪种格式

有什么办法帮我吗? 非常感谢

model2 =stlm(y,modelfunction=nnfor::elm)

> Error in `+.default`(fitted(fit), allseas) : 
  time-series/vector length mismatch