Description Usage Arguments Details Value Author(s) See Also Examples
Computes the root mean sqaured error and mean absolute error for a series of forecasts or for forecasts and real data.
1 | cf.forecasts(m1, m2)
|
m1 |
Matrix of VAR forecasts produced by |
m2 |
Matrix of VAR forecasts or a matrix of real data to compare to forecasts. |
Simple RMSE and MAE computation for the forecasts. The reported values are summed over the series and time points.
An object with two elements:
rmse |
Forecast RMSE |
mae |
Forecast MAE |
Patrick T. Brandt
forecast
for forecast computations
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(IsraelPalestineConflict)
Y.sample1 <- window(IsraelPalestineConflict, end=c(2002, 52))
Y.sample2 <- window(IsraelPalestineConflict, start=c(2003,1))
# Fit a BVAR model
fit.bvar <- szbvar(Y.sample1, p=6, lambda0=0.6, lambda1=0.1, lambda3=2,
lambda4=0.25, lambda5=0, mu5=0, mu6=0, prior=0)
# Forecast -- this gives back the sample PLUS the forecasts!
forecasts <- forecast(fit.bvar, nsteps=nrow(Y.sample2))
# Compare forecasts to real data
cf.forecasts(forecasts[(nrow(Y.sample1)+1):nrow(forecasts),], Y.sample2)
|
##
## MSBVAR Package v.0.9-2
## Build date: Thu Jul 20 09:22:07 2017
## Copyright (C) 2005-2017, Patrick T. Brandt
## Written by Patrick T. Brandt
##
## Support provided by the U.S. National Science Foundation
## (Grants SES-0351179, SES-0351205, SES-0540816, and SES-0921051)
##
[1] 85.50756 57.04836
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.