1616# #
1717# ###############################################################################
1818
19- # 08/31/2017
20-
21- forecast.Rcpp_bvarm <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,varnames = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
22- return = .forecast_var(obj ,periods ,shocks ,plot ,varnames ,percentiles ,useMean ,backdata ,save ,height ,width )
19+ forecast.Rcpp_bvarm <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,var_names = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
20+ return = .forecast_var(obj ,periods ,shocks ,plot ,var_names ,percentiles ,useMean ,backdata ,save ,height ,width )
2321}
2422
25- forecast.Rcpp_bvars <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,varnames = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
26- return = .forecast_var(obj ,periods ,shocks ,plot ,varnames ,percentiles ,useMean ,backdata ,save ,height ,width )
23+ forecast.Rcpp_bvars <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,var_names = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
24+ return = .forecast_var(obj ,periods ,shocks ,plot ,var_names ,percentiles ,useMean ,backdata ,save ,height ,width )
2725}
2826
29- forecast.Rcpp_bvarw <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,varnames = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
30- return = .forecast_var(obj ,periods ,shocks ,plot ,varnames ,percentiles ,useMean ,backdata ,save ,height ,width )
27+ forecast.Rcpp_bvarw <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,var_names = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
28+ return = .forecast_var(obj ,periods ,shocks ,plot ,var_names ,percentiles ,useMean ,backdata ,save ,height ,width )
3129}
3230
33- forecast.Rcpp_cvar <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,varnames = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
34- return = .forecast_var(obj ,periods ,shocks ,plot ,varnames ,percentiles ,useMean ,backdata ,save ,height ,width )
31+ forecast.Rcpp_cvar <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,var_names = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
32+ return = .forecast_var(obj ,periods ,shocks ,plot ,var_names ,percentiles ,useMean ,backdata ,save ,height ,width )
3533}
3634
3735forecast.EDSGE <- function (obj ,periods = 20 ,plot = TRUE ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
38- forecastdata <- .forecastdsge (obj ,periods ,plot ,percentiles ,useMean ,backdata ,save ,height ,width )
36+ forecastdata <- .forecast_dsge (obj ,periods ,plot ,percentiles ,useMean ,backdata ,save ,height ,width )
3937 return = list (MeanForecast = forecastdata $ MeanForecast ,PointForecast = forecastdata $ PointForecast ,Forecasts = forecastdata $ Forecasts )
4038}
4139
4240forecast.DSGEVAR <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ,... ){
43- forecastdata <- .forecastdsgevar (obj ,periods ,shocks ,plot ,percentiles ,useMean ,backdata ,save ,height ,width )
41+ forecastdata <- .forecast_dsgevar (obj ,periods ,shocks ,plot ,percentiles ,useMean ,backdata ,save ,height ,width )
4442 return = list (MeanForecast = forecastdata $ MeanForecast ,PointForecast = forecastdata $ PointForecast ,Forecasts = forecastdata $ Forecasts )
4543}
4644
47- .forecast_var <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,varnames = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ){
45+ .forecast_var <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,var_names = NULL ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ){
4846
4947 # if(getRversion() >= "3.1.0") utils::suppressForeignCheck(names=c("Time", "FCL", "FCU", "FCM"))
5048
@@ -107,10 +105,10 @@ forecast.DSGEVAR <- function(obj,periods=20,shocks=TRUE,plot=TRUE,percentiles=c(
107105
108106 pushViewport(viewport(layout = grid.layout(M ,1 )))
109107
110- if (class(varnames ) != " character" ) {
111- varnames <- character (length = M )
108+ if (class(var_names ) != " character" ) {
109+ var_names <- character (length = M )
112110 for (i in 1 : M ) {
113- varnames [i ] <- paste(" VAR" ,i ,sep = " " )
111+ var_names [i ] <- paste(" VAR" ,i ,sep = " " )
114112 }
115113 }
116114
@@ -119,7 +117,7 @@ forecast.DSGEVAR <- function(obj,periods=20,shocks=TRUE,plot=TRUE,percentiles=c(
119117 if (backdata > 0 ) {
120118 # Include a dashed line to mark where the forecast begins
121119 for (i in 1 : M ) {
122- FCastName <- varnames [i ]
120+ FCastName <- var_names [i ]
123121 FCDF <- ForecastData [,,i ]
124122 FCDF <- data.frame (FCDF )
125123 colnames(FCDF ) <- c(" FCL" ," FCM" ," FCU" ," Time" )
@@ -130,7 +128,7 @@ forecast.DSGEVAR <- function(obj,periods=20,shocks=TRUE,plot=TRUE,percentiles=c(
130128 }
131129 } else {
132130 for (i in 1 : M ) {
133- FCastName <- varnames [i ]
131+ FCastName <- var_names [i ]
134132 FCDF <- ForecastData [,,i ]
135133 FCDF <- data.frame (FCDF )
136134 colnames(FCDF ) <- c(" FCL" ," FCM" ," FCU" ," Time" )
@@ -146,7 +144,7 @@ forecast.DSGEVAR <- function(obj,periods=20,shocks=TRUE,plot=TRUE,percentiles=c(
146144 return = list (MeanForecast = forecast_mean ,PointForecast = forecast_sorted [,,mid_conf ])
147145}
148146
149- .forecastdsge <- function (obj ,periods = 20 ,plot = TRUE ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ){
147+ .forecast_dsge <- function (obj ,periods = 20 ,plot = TRUE ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ){
150148 #
151149 DSGEPars <- obj $ Parameters
152150 partomats <- obj $ partomats
@@ -251,7 +249,7 @@ forecast.DSGEVAR <- function(obj,periods=20,shocks=TRUE,plot=TRUE,percentiles=c(
251249 return = list (MeanForecast = ForecastsMean ,PointForecast = ForecastsSorted [,,MidCInt ],Forecasts = Forecasts )
252250}
253251
254- .forecastdsgevar <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ){
252+ .forecast_dsgevar <- function (obj ,periods = 20 ,shocks = TRUE ,plot = TRUE ,percentiles = c(.05 ,.50 ,.95 ),useMean = FALSE ,backdata = 0 ,save = FALSE ,height = 13 ,width = 11 ){
255253 #
256254 Betas <- obj $ Beta
257255 Sigmas <- obj $ Sigma
0 commit comments