r中某些时间序列的AR模型错误

时间:2019-05-15 09:25:30

标签: r time-series autoregressive-models

我有一些时间序列,我正在尝试使用AIC方法找到它们的自回归相关性。但是,在某些时间序列中,它们会不断产生错误。以下是这些时间序列之一:

ts = c(NA, -5.29677810703267, 20.924713499646, -12.9426706411937, 
-59.8965047914283, 28.0656367870643, -14.0538201675938, 71.7475500827194, 
-26.5278267238737, 21.1224751507487, -8.29911855529105, 4.20981789612903, 
1.6517102431311, -20.9710157761627, 9.34406557636963, -0.400619961149677, 
24.7973533494015, -2.05958875385488, NA, NA, 8.06434983475257, 
48.0120034574876, -120.083129642974, 42.781376271489, -24.3920530610003, 
-40.6009919023201, -9.84301451434842, -30.115695158963, 43.5833919019582, 
13.2566724065373, 32.9065720928964, 24.5355166991576, 19.1459319634431, 
-5.259756376125, -21.6791225814247, 43.8902590856663, -68.5491856367301, 
-8.99503101049164, -66.4448512974963, 27.1037792403782, NA, 68.2060957432526, 
21.7646331844968, -19.6686755968915, 15.9085951372099, -32.5011288750771, 
1.1045781043698, 44.7281418136726, -72.6280120090465, -37.9614576256654, 
NA, 61.4494787118858, 56.1987121423001, -1.01964326869703, 96.7968382170166, 
-63.3494176624368, NA, -44.5204385643568, -126.540352110579, 
124.48669993052, -21.4368567029375, 10.6914037271706, 34.8739069589663, 
-74.8869212694283, -43.588655219891, 17.7711308457003, -4.80513733453226, 
-23.3150340224666, -33.7561334799807, 105.873990031048, NA, 66.3576089112204, 
-23.7840442433912, 70.1552285230281, -71.8221470513996, -57.7137452285522, 
66.4828597296925, 7.77009356145655, -62.849617995138, -35.3738492019689, 
27.1998256790859, -76.1261676138515, 69.6505966573409, -9.46745576921455, 
54.5221008446041, -7.37830776308098, 22.8337441458523, -28.8393176904739, 
-52.3950675339376, 42.1689203535835)

> ar(x, aic = TRUE, na.action=na.pass)

Error in if (order) coefs[order, seq_len(order)] else numeric() : 
  argument is not interpretable as logical
In addition: Warning messages:
1: In log(var.pred) : NaNs produced
2: In if (order) coefs[order, seq_len(order)] else numeric() :
  the condition has length > 1 and only the first element will be used

有人知道是什么问题吗?

0 个答案:

没有答案