Use ggplot2 to visualize the marginal forecast quantiles, or a few sample
paths of a threedx forecast object of class threedx_paths
Arguments
- object
An object of class
threedx_pathsas returned by[predict.threedx()]- ...
ignored
- method
One of
forecastfor visualization of quantiles of the marginal forecast distribution (i.e., the usual fanchart), orpathsto visualize a few sample paths from the joint forecast distribution- date
Optional additional vector with dates in format that can be cast to
YYYY-MM-DDwith same length asobject$y, used to create x-axis- date_future
Optional additional vector with dates in format that can be cast to
YYYY-MM-DDwith same length asobject$y, used to create x-axis for forecast path- show_params
Logical; if
TRUE(default) then fitted params will be displayed usingggplot2::facet_wrap()- n
Number of paths to add to plot, a small number is recommended to be able to see the individual paths; positive scalar integer; used when
methodis"paths"- alpha
The transparency parameter used when adding the paths to the plot, provided to
ggplot2::geom_point()andggplot2::geom_line(); used whenmethodis"paths"
Details
Note: This function will use base::sample() to randomly select paths that
are added to the plot. Set a seed if you require reproducibility.