Plots of fitted values of dependent variables including their median and percentiles.
## S3 method for class 'Forecasts'plot( x, probability =0.9, data_in_plot =1, col ="#ff69b4", main, xlab, mar.multi = c(1,4.6,0,2.1), oma.multi = c(6,0,5,0),...)
Arguments
x: an object of class Forecasts obtained using the forecast() function containing posterior draws of fitted values of dependent variables.
probability: a parameter determining the interval to be plotted. The interval stretches from the 0.5 * (1 - probability) to 1 - 0.5 * (1 - probability) percentile of the posterior distribution.
data_in_plot: a fraction value in the range (0, 1) determining how many of the last observations in the data should be plotted with the forecasts.
col: a colour of the plot line and the ribbon
main: an alternative main title for the plot
xlab: an alternative x-axis label for the plot
mar.multi: the default mar argument setting in graphics::par. Modify with care!
oma.multi: the default oma argument setting in graphics::par. Modify with care!
...: additional arguments affecting the summary produced.
Examples
data(us_fiscal_lsuw)# upload dataset.seed(123)# set seedspecification = specify_bsvar$new(us_fiscal_lsuw)# specify modelburn_in = estimate(specification,10)# run the burn-inposterior = estimate(burn_in,20, thin =1)# estimate the model# compute forecastsfore = forecast(posterior, horizon =4)plot(fore)# plot forecasts# workflow with the pipe |>############################################################set.seed(123)us_fiscal_lsuw |> specify_bsvar$new()|> estimate(S =10)|> estimate(S =20, thin =1)|> forecast(horizon =4)|> plot()