简体   繁体   English

当我们在 R 中计算 ARIMA 模型时,如何解决标准误差、z 和 pr 值的 NA 值? 在 sqrt(diag(x$var.coef)) 中:产生 NaN

[英]How to solve NA values for standard errors, z and pr values when we are calculation ARIMA model in R? In sqrt(diag(x$var.coef)) : NaNs produced

I have been doing future forecasting using ARIMA model in R programming language but when I run ARIMA model from the forecast package, my standard errors are not calculated properly and got an NA error.我一直在使用 R 编程语言中的 ARIMA 模型进行未来预测,但是当我从预测包中运行 ARIMA 模型时,我的标准误差计算不正确并出现NA错误。 Could you please advise me in order to solve this issue?你能建议我解决这个问题吗?

arima(5,1,5)有马(5,1,5)

arima515 <- Arima(GSPC$SP500, 
                  order = c(5, 1, 5), 
                  include.constant = TRUE,
                  optim.control = list(maxit = 500),)

coeftest(arima515)

Output:输出:

z test of coefficients:

       Estimate Std. Error z value Pr(>|z|)   
ar1    0.074793         NA      NA       NA   
ar2    0.142322         NA      NA       NA   
ar3    0.754132         NA      NA       NA   
ar4    0.179091         NA      NA       NA   
ar5   -0.370530         NA      NA       NA   
ma1   -0.122067         NA      NA       NA   
ma2   -0.180075         NA      NA       NA   
ma3   -0.751949         NA      NA       NA   
ma4   -0.147119         NA      NA       NA   
ma5    0.381992         NA      NA       NA   
drift  0.387899   0.132093  2.9366 0.003319 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Warning message:
In sqrt(diag(se)) : NaNs produced

As you can see above that errors, z values and pr are NA .正如您在上面看到的那样,错误、 z值和prNA

I don't know if I understand correctly the question, but if you want only parameter standard errors you could only call arima515 or summary(arima515) , like this我不知道我是否正确理解了这个问题,但如果你只想要参数标准错误,你只能调用arima515summary(arima515) ,像这样


arima515 <- Arima(cop[,1], 
                  order = c(5, 1, 5), 
                  include.constant = TRUE,
                  optim.control = list(maxit = 500))

summary(arima515)

Series: cop[, 1] 
ARIMA(5,1,5) with drift 

Coefficients:
          ar1      ar2      ar3      ar4     ar5      ma1     ma2      ma3
      -0.7413  -1.2671  -0.5753  -0.3700  0.0221  -0.2412  0.5399  -0.7129
s.e.   1.4269   0.6982   1.1093   0.5289  0.0852   1.4266  1.1724   0.8139
          ma4      ma5   drift
      -0.1744  -0.4114  -1e-04
s.e.   1.0093   0.5184   1e-04

sigma^2 estimated as 0.5005:  log likelihood=-801.31
AIC=1626.63   AICc=1627.05   BIC=1682.05

Training set error measures:
                       ME      RMSE      MAE  MPE MAPE      MASE
Training set -0.005256166 0.7017616 0.513783 -Inf  Inf 0.6721109
                      ACF1
Training set -0.0009624799

you will get parameter estimates and se See the documentation for coeftest and see which object you can use for this function.您将获得参数估计和 se 请参阅coeftest的文档,并查看您可以为此函数使用哪个对象。 Instead if you wanted to test anything else for your Arima model tell us what you wanted to do.相反,如果您想为您的Arima模型测试任何其他内容,请告诉我们您想要做什么。

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

相关问题 zeroinfl model - 警告消息:在 sqrt(diag(object$vcov)) 中:产生了 NaN - zeroinfl model - Warning message: In sqrt(diag(object$vcov)) : NaNs produced R中来自irr包的Kappam.light:警告sqrt(varkappa),产生了NAns,kappa = NA,z-value = NA和p-value = NA - Kappam.light from irr package in R: Warning sqrt(varkappa), NAns produced, kappa = NA, z-value=NA and p-value=NA 用NA值拟合Arima模型 - Fitted Arima Model with NA values 为什么rmvnorm()函数返回“在sqrt(ev $值):NaNs产生”,这个错误是什么以及如何纠正或避免? - Why is rmvnorm() function returning “In sqrt(ev$values) : NaNs produced”, what is this error and how can it be corrected or avoided? 用R绘制线性模型(lm)时产生的NaN - NaNs produced when plotting a linear model (lm) with R 我应该如何使用华宇 Model 获得 R 中的预测值? - How should I get the forecasted values in R using Arima Model? 警告消息:在 log(z) 中:在 R 中计算 fevd GEV 时产生的 NaN - Warning message: In log(z) : NaNs produced when computing fevd GEV in R 执行z归一化时如何排除列中的NA值 - How to exlude NA values in a column when performing z-normalization 减去R数据帧中的列,但当另一个为NA时保留var1或var2的值 - Subtract columns in R data frame but keep values of var1 or var2 when the other is NA 缺失值 - Arima 模型 - Missing values - Arima model
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM