plot_forecast: Plot the marginal quantile forecast of a 'tulip' model

View source: R/autoplot.R

plot_forecastR Documentation

Plot the marginal quantile forecast of a tulip model

Description

This function requires the ggplot2. Whether its namespace is available will be checked when the function is run. ggplot2 is only suggested, not a default import.

Usage

plot_forecast(object, date = NULL, date_future = NULL, show_params = TRUE)

Arguments

object

An object of class tulip_paths as returned by predict.tulip()

date

Optional additional vector with dates in format that can be cast to YYYY-MM-DD with same length as object$y, used to create x-axis

date_future

Optional additional vector with dates in format that can be cast to YYYY-MM-DD with same length as object$y, used to create x-axis for forecast paths

show_params

Logical; if TRUE (default) then fitted params will be displayed using ggplot2::facet_wrap()

Examples

set.seed(4278)
y <- rt(100, df = 10) * 10 + 1:100

fitted <- tulip(y = y, m = 12, family = "norm")
paths <- predict(object = fitted, h = 12)

tulip:::plot_forecast(object = paths)


timradtke/heuristika documentation built on April 24, 2023, 1:55 a.m.