简体   繁体   English

tsoutliers软件包中的tso函数语法问题

[英]Syntax issue with tso function in tsoutliers package

I have a data frame (3575 observations long) with two columns, Date and Oxygen Concentration. 我有一个数据框(长3575个观测值),其中有两列,日期和氧气浓度。 Date is in YYYY-MM-DD format for 25 years and oxygen values are numbers running anywhere from 0.05 to 7.5. 日期采用YYYY-MM-DD格式,使用25年,氧气值是介于0.05到7.5之间的数字。 I'm trying to locate outliers in my dataset using the tsoutliers package and my problem is with the syntax and not the values of the data themselves. 我正在尝试使用tsoutliers包在数据集中找到异常值,而我的问题是语法而不是数据本身的值。

I first used the auto.arima function with this code: 我首先将auto.arima函数与以下代码结合使用:

auto.arima(Site7$Oxygen, seasonal = TRUE, stepwise = FALSE)

I'm sorry about not being able to give a minimum reproducible example but given the scale of the data and tests, it would be quite difficult to put it all in here. 对于无法给出最小的可复制示例感到遗憾,但是鉴于数据和测试的规模,很难将所有内容都放在此处。

For the results I got: 对于结果,我得到了:

Series: Date$Oxygen  
ARIMA(3,1,2) 

Coefficients:
         ar1     ar2     ar3      ma1      ma2
      0.2988  0.2439  0.1431  -0.4348  -0.5259 
s.e.  0.0947  0.0686  0.0316   0.0948   0.0772

sigma^2 estimated as 0.5999:  log likelihood=-4145.53 
AIC=8303.06   AICc=8303.09   BIC=8340.15

Now, as I'm trying to visualize Additive Outliers I used the tso() command with this code: 现在,当我试图可视化加法异常值时,我将tso()命令与以下代码一起使用:

AOoutliers <- tso(Date$Oxygen,types = "AO", maxit = 10, tsmethod = c("arima"), args.tsmethod = list(order =c(3,1,2)))

I now have this error which I can't seem to figure out: 我现在有这个错误,我似乎无法找出:

Error in tso0(x = y, xreg = xreg, cval = cval, delta = delta, n.start = n.start, : trying to get slot "y" from an object of a basic class ("numeric") with no slots tso0中的错误(x = y,xreg = xreg,cval = cval,delta = delta,n.start = n.start ,:尝试从基本类(“数字”)的对象获取槽“ y”,而没有插槽

Any help would be greatly appreciated. 任何帮助将不胜感激。 Thank you. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM