predict.artfima {artfima} | R Documentation |
Predict method for artfima
Description
The optimal minimum mean square error forecast and its standard deviation for lags 1, 2, ..., n.ahead is computed at forecast origin starting at the end of the observed series used in fitting. The exact algorithm discussed in McLeod, Yu and Krougly is used.
Usage
## S3 method for class 'artfima'
predict(object, n.ahead=10, ...)
Arguments
object |
object of class "artfima" |
n.ahead |
number of steps ahead to forecast |
... |
optional arguments |
Value
a list with two components
Forecasts |
Description of 'comp1' |
SDForecasts |
Description of 'comp2' |
Author(s)
A. I. McLeod, aimcleod@uwo.ca
References
McLeod, A.I., Yu, Hao and Krougly, Z. (2007). Algorithms for Linear Time Series Analysis: With R Package. Journal of Statistical Software 23/5 1-26.
See Also
Examples
ans <- artfima(seriesa, likAlg="Whittle")
predict(ans)
#compare forecasts from ARTFIMA etc.
## Not run:
ML <- 10
ans <- artfima(seriesa)
Ftfd <- predict(ans, n.ahead=10)$Forecasts
ans <- artfima(seriesa, glp="ARIMA", arimaOrder=c(1,0,1))
Farma11 <- predict(ans, n.ahead=10)$Forecasts
ans <- artfima(seriesa, glp="ARFIMA")
Ffd <- predict(ans, n.ahead=10)$Forecasts
#arima(0,1,1)
ans <- arima(seriesa, order=c(0,1,1))
fEWMA <- predict(ans, n.ahead=10)$pred
yobs<-seriesa[188:197]
xobs<-188:197
y <- matrix(c(yobs,Ffd,Ftfd,Farma11,fEWMA), ncol=5)
colnames(y)<-c("obs", "FD", "TFD", "ARMA11","FEWMA")
x <- 197+1:ML
x <- matrix(c(xobs, rep(x, 4)), ncol=5)
plot(x, y, type="n", col=c("black", "red", "blue", "magenta"),
xlab="t", ylab=expression(z[t]))
x <- 197+1:ML
points(xobs, yobs, type="o", col="black")
points(x, Ffd, type="o", col="red")
points(x, Ftfd, type="o", col="blue")
points(x, Farma11, type="o", col="brown")
points(x, fEWMA, type="o", col="magenta")
legend(200, 18.1, legend=c("observed", "EWMA", "FD", "TFD", "ARMA"),
col=c("black", "magenta", "red", "blue", "brown"),
lty=c(rep(1,5)))
## End(Not run)
[Package artfima version 1.5 Index]