[R] Prediction from Arima model
Rui Barradas
ru|pb@rr@d@@ @end|ng |rom @@po@pt
Sat Aug 31 23:06:27 CEST 2024
Às 18:54 de 31/08/2024, Christofer Bogaso escreveu:
> Hi,
>
> I have run following code to obtain one step ahead confidence interval
> from am arima model
>
> library(forecast)
>
> set.seed(100)
>
> forecast(Arima(rnorm(100), order = c(1,0,1), xreg = rt(100, 1)), h =
> 1, xreg = 10)
>
> However this appear to provide the Prediction interval, however I
> wanted to get the confidence interval for the new value.
>
> Is there any way to get the confidence interval for the new value?
>
> I also wanted to get the estimate of SE for the new value which is
> used to obtain the confidence interval of the new value. Is there any
> method available to obtain that?
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide https://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Hello,
To get the se use ?predict.Arima instead.
library(forecast)
set.seed(100)
model <- Arima(rnorm(100), order = c(1,0,1), xreg = rt(100, 1))
# in predict.Arima, se.fit defaults to TRUE
pred <- predict(model, n.ahead = 1, newxreg = 10)
pred$se
c(pred$se)
# with more points ahead
predict(model, n.ahead = 2, newxreg = c(10, 12))
Hope this helps,
Rui Barradas
--
Este e-mail foi analisado pelo software antivírus AVG para verificar a presença de vírus.
www.avg.com
More information about the R-help
mailing list