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?
Sent from my iPhone> On Aug 31, 2024, at 10:55?AM, Christofer Bogaso <bogaso.christofer at gmail.com> wrote: > > ?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?m not sure it makes sense to output a confidence interval when you are projecting a time series. If you wanted a confidence interval on the past data then you can just use standard descriptive methods. ? David.> > 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 at 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.
?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 at 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