matrix_to_mforecast: Transform simple matrix of forecasts to mforecast object.

Description Usage Arguments Details Value Examples

View source: R/time_series_misc.R

Description

matrix_to_mforecast transform simple matrix of forecasts to complex mforecast object.

Usage

1
matrix_to_mforecast(forecast_matrix, y_before, method = "Unspecified")

Arguments

forecast_matrix

h by m forecast matrix

y_before

tibble with three columns: variable, mean, sd

method

the name of the method

Details

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

Value

complex mforecast object

Examples

1
2
3
4
5
data(rus_macro)
y_small <- rus_macro[, c("cpi", "employment", "m2")]
y_forecast <- tail(y_small, 1) # trivial forecast 
mfor <- matrix_to_mforecast(y_forecast, y_small, method = "Trivial")
# ggplot2:::autoplot.mforecast(mfor) # TODO: does not work!!!

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