Description Usage Arguments Value Author(s) References See Also Examples
View source: R/predict.artfima.R
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.
1 2 |
object |
object of class "artfima" |
n.ahead |
number of steps ahead to forecast |
... |
optional arguments |
a list with two components
Forecasts |
Description of 'comp1' |
SDForecasts |
Description of 'comp2' |
A. I. McLeod, aimcleod@uwo.ca
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.