View source: R/forecast-methods.R
plot.fv_forecast | R Documentation |
plot
method for class "fv_forecast". The type of plot
produced can be controlled using the target
and type
arguments with the
latter only being functional when target
is set to "posterior" or
"forecast".
## S3 method for class 'fv_forecast'
plot(x, obs = NULL, target = "posterior", type = "cases", ...)
x |
A |
obs |
A data frame of observed data as produced by |
target |
A character string indicating the target object within the
|
type |
A character string indicating the type of plot required,
defaulting to "cases". Current options are: "cases" which calls
|
... |
Pass additional arguments to lower level plot functions. |
ggplot2
object
plot.fv_posterior
Functions used for forecasting across models, dates, and scenarios
forecast_across_dates()
,
forecast_across_scenarios()
,
forecast_n_strain()
,
forecast()
,
summary.fv_forecast()
,
unnest_posterior()
Plotting functions
add_forecast_dates()
,
plot.fv_posterior()
,
plot_cases()
,
plot_default()
,
plot_growth()
,
plot_pairs()
,
plot_posterior()
,
plot_rt()
,
plot_theme()
,
plot_voc_advantage()
,
plot_voc_frac()
,
save_plots()
options(mc.cores = 4)
forecasts <- forecast(
germany_covid19_delta_obs,
forecast_date = as.Date("2021-06-12"),
horizon = 4,
strains = c(1, 2),
adapt_delta = 0.99,
max_treedepth = 15,
variant_relationship = "scaled"
)
# inspect forecasts
forecasts
# plot case posterior predictions
plot(forecasts, log = TRUE)
# plot case posterior predictions with central estimates
plot(forecasts, log = TRUE, central = TRUE)
# plot voc posterior predictions
plot(forecasts, type = "voc_frac")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.