简体   繁体   English

R中auto.arima的训练数据集

[英]Training data set for auto.arima in R

I have around 10000 time series. 我有大约10000个时间序列。

I wanted to use auto.arima function http://www.inside-r.org/packages/cran/forecast/docs/auto.arima 我想使用auto.arima函数http://www.inside-r.org/packages/cran/forecast/docs/auto.arima

I wanted to test the accuracy of my auto.arima model for the 10000 time series. 我想测试10000个时间序列的auto.arima模型的准确性。 I am holding off 20% of data points (if you see sample out of 40 I will hold off 8) and then let auto.arima predict. 我保留了20%的数据点(如果您看到40个样本中的样本,我将保留8个),然后让auto.arima进行预测。 Then I can compare generated 8 values with actual 8 values. 然后,我可以将生成的8个值与实际的8个值进行比较。
But is there a formal way to test accuracy in ARIMA model? 但是,有没有一种正式的方法可以测试ARIMA模型的准确性? Is my approach correcT? 我的方法正确吗?

y=auto.arima(x)
plot(forecast(y,h=8))

Sample time series 1 采样时间序列1

0.0003748,0.0003929,0.0003653,0.0003557,0.0004463,0.000349,0.0003099,0.0003395,0.0003157,0.0002871,0.0002604,0.0002422,0.0001917,0.0002117,0.0002689

time series 2 时间序列2

0.0003977,0.0003481,0.0002413,0.0002069,0.0002127,0.0002108,0.0002003,0.0002174,0.0002098,0.0002069,0.0001955,0.0001926,0.0002108,0.0002146,0.0002079

It sounds to me like your Q is about the different metrics for comparing forecast accuracy, more than the specific use of auto.arima() and forecast() . 在我看来,您的Q与用于比较预测准确性的不同指标有关,而不是与auto.arima()forecast()的特定用法有关。 If so, then there are a number of metrics that can be used. 如果是这样,那么可以使用许多指标。 For an overview, see 有关概述,请参见

https://en.wikipedia.org/wiki/Forecasting#Forecasting_accuracy https://zh.wikipedia.org/wiki/Forecasting#Forecasting_accuracy

Each of them has its proponents and detractors; 他们每个人都有其支持者和反对者; for example, see this paper: 例如,请参见本文:

http://robjhyndman.com/papers/mase.pdf http://robjhyndman.com/papers/mase.pdf

Independent of what accuracy metric you use, you still need to be able to justify why you are holding back 20% of the data for forecasting. 不管使用哪种精度指标,您仍然需要能够证明为什么要保留20%的数据用于预测。

If, however, you are interested in the different model forms, then you also have some options. 但是,如果您对不同的模型形式感兴趣,那么您也可以选择。 For example, as suggested in the comments, 例如,如评论中所建议,

  1. fit the same univariate model (specified a priori ) to each time series using arima() (or some equivalent); 使用arima() (或某些等效方法)将相同的单变量模型(指定为先验 )拟合到每个时间序列;
  2. fit a (potentially) different univariate model to each time series using auto.arima() ; 使用auto.arima()将(可能)不同的单变量模型拟合到每个时间序列; or 要么
  3. fit a multivariate model to all time series. 使多元模型适合所有时间序列。

If it's #3 you're interested in, I'd suggest the MARSS pkg here: 如果您感兴趣的是#3,我建议在这里提出MARSS pkg:

https://cran.r-project.org/web/packages/MARSS/index.html https://cran.r-project.org/web/packages/MARSS/index.html

and user's guide here: 和用户指南在这里:

https://cran.r-project.org/web/packages/MARSS/vignettes/UserGuide.pdf https://cran.r-project.org/web/packages/MARSS/vignettes/UserGuide.pdf

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

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