'Invalid term in model formula' 调用时 R.armaFit

'Invalid term in model formula' when calling R.armaFit

我收到这条消息:

Error in terms.formula(formula, data = data) :

invalid term in model formula

调用这段代码时:

let data : float[] = // ...
R.eval(R.parse(text="library(fArma)")) |> ignore

let dataset =
    namedParams["XX", box data]
    |> R.data_frame

let fitted = R.armaFit(formula="XX ~ arma(1 , 1)", data=dataset)

错误是由最后一行触发的。

我试过删除 boxXX ~,但我得到了相同的结果。

我试图遵循这个指南: https://www.r-bloggers.com/arma-models-for-trading/

日志报告如下:

[03/02/17 18:01:46] [Pid:10004, Tid:1, Apid:1] eval(base::data.frame(XX=fsr_10004_3)) [03/02/17 18:01:46] [Pid:10004, Tid:1, Apid:1] Output: [03/02/17 18:01:50] [Pid:10004, Tid:1, Apid:1] eval(fArma::armaFit(formula=fsr_10004_4, data=fsr_10004_5)) [03/02/17 18:01:50] [Pid:10004, Tid:1, Apid:1] Output: Error in terms.formula(formula, data = data) : invalid term in model formula

[03/02/17 18:01:50] [Pid:10004, Tid:1, Apid:1] Operation failed:
RDotNet.EvaluationException: Error in terms.formula(formula, data = data) : invalid term in model formula

let armaFit = R.armaFit(R.as_formula("xx ~ arma(1,1)"), dataset)