我正在尝试在时间序列分析中包括外源回归器
elm_nn<-elm(ts(df),
m=1,
hd=NULL,
type="step",
reps = 20,
comb = "median",
difforder = c(0:12),
outplot =TRUE,
sel.lag=FALSE,
direct = FALSE,
allow.det.season = TRUE,
det.type = "auto",
xreg =reg)
使用
df<-c(0,0,173,0,0,80,0)
reg<-c(182,135,30,203,150,83,163)
package documentation中的信息暗示xreg是一列,大概是来自表的列。使用ARIMA时,我有一个用作xreg的向量,它执行时没有问题。但是,在elm中使用相同的向量会生成错误Error in xreg[1, ] : incorrect number of dimensions
。我找不到有关专门针对时间序列的极限学习机的外源回归器的信息。任何帮助将不胜感激。
答案 0 :(得分:0)
当我将列表转换为表格时,R似乎在新列中添加了一个带有字母数字值的附加列,看起来像A1,B1,...,Z1,A2,...
,称为Var1。尝试删除此列会将其转换为一行,并生成以下警告消息:
Warning message:
In reg$Var1 <- NULL : Coercing LHS to a list
通过将向量转换为数据帧,我可以毫无问题地使用它。