Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(forecast)
- data<-c(2,3,2,3,2,3)
- forecast(Arima(data,order=c(0,0,0)))$mean
- [1] 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5 2.5
- forecast(Arima(data,order=c(0,0,0), lambda=0))$mean
- [1] 2.44949 2.44949 2.44949 2.44949 2.44949 2.44949 2.44949 2.44949 2.44949 2.44949
- library(forecast)
- fit <- auto.arima(AirPassengers, lambda=0)
- fc <- forecast(fit, h=50, level=95)
- fvar <- ((BoxCox(fc$upper,fit$lambda)-BoxCox(fc$lower,fit$lambda))/qnorm(0.975)/2)^2
- plot(fc)
- fc$mean <- fc$mean * (1 + 0.5*fvar)
- lines(fc$mean,col='red')
- fit <- auto.arima(AirPassengers, lambda=0.2)
- fc <- forecast(fit, h=50, level=95)
- fvar <- ((BoxCox(fc$upper,fit$lambda)-BoxCox(fc$lower,fit$lambda))/qnorm(0.975)/2)^2
- plot(fc)
- fc$mean <- fc$mean * (1 + 0.5*fvar*(1-fit$lambda)/(fc$mean)^(2*fit$lambda))
- lines(fc$mean,col='red')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement