mforecast_to_matrix: Transform mforecast object to simple matrix of forecasts.

Description Usage Arguments Details Value Examples

View source: R/time_series_misc.R

Description

mforecast_to_matrix transform complex mforecast object to simple matrix of forecasts.

Usage

1

Arguments

mforecast

mforecast object to be transformed

Details

forecast package uses complex mforecast format to store forecasts. This function transforms mforecast objects to simple matrices.

Value

h by m matrix (h <e2><80><94> number of steps, m <e2><80><94> number of variables)

Examples

1
2
3
4
5
data(rus_macro)
y_small <- rus_macro[, c("cpi", "employment", "m2")]
var_model <- vars::VAR(y_small)
y_for <- forecast::forecast(var_model, h = 2)
mforecast_to_matrix(y_for)

bdemeshev/torro documentation built on May 21, 2019, 8:36 a.m.