Learn R Programming

APRScenario (version 0.0.3.0)

plot_cond_forc: plot_cond_forc function; Data should conatain the variable "variable", the "hor" horizon and a "history"

Description

plot_cond_forc function; Data should conatain the variable "variable", the "hor" horizon and a "history"

Usage

plot_cond_forc(
  varbl2plot = NULL,
  y_h_cond = NULL,
  center = 0.5,
  lower = 0.16,
  upper = 0.84,
  T.start = NULL,
  T.end = NULL,
  before = 8,
  freq = "quarter",
  y_data = NULL
)

Value

list of plot and data used

Arguments

varbl2plot

name of variable to be plotted (string)

y_h_cond

conditional forecast data frame (eg from SimScen) with names c("hor","variable","lower","center","upper"): hor is a Date object

center

(optional, default 0.5) quantile of the mid value

lower

(optional, default 0.16) quantile of lower range

upper

(optional, default 0.84) quantile of upper range

T.start

start date of the forecast

T.end

end of the forecast

before

(integer: optional) periods of data in the plot: default 8 periods

freq

(optional, default 'quarter') frequency of the data (eg 'quarter' or 'month')

y_data

Data used in the estimation eg t(specification$get_data_matrices()$Y) %>% as.data.frame(); true_data$hor=dates

Examples

Run this code
if (FALSE) {
# Example usage with conditional forecast data
plot_result <- plot_cond_forc(varbl2plot = "GDP", 
                              y_h_cond = forecast_data,
                              T.start = as.Date("2023-01-01"),
                              T.end = as.Date("2024-01-01"),
                              y_data = historical_data)
}

Run the code above in your browser using DataLab