Reputation: 2386
I'd like to fix the Variance value in an Arima model. How can I specify this. From what I can tell it cannot be set through the fixed parameter.
Thanks!
Upvotes: 0
Views: 1188
Reputation: 8267
This is going to be an ugly hack, but it should work.
Load the forecast
library and create an ARIMA fit of the specified order so we have a template.
library(fit)
fit <- Arima(WWWusage,order=c(3,0,1))
Examine the components of fit
.
names(fit)
Change them to match the model you want to forecast - the variance is in the sigma2
component:
fit$coef <- structure(c(1,-.2,1,0.2,100),.Names=names(fit$coef))
fit$sigma2 <- 20
And forecast, using forecast.Arima()
:
forecast(fit,h=20)
plot(forecast(fit,h=20))
You may also want to look at arima.sim()
and feed the residual variance into the rand.gen
innovations generator.
Upvotes: 1