|
16 | 16 | ##
|
17 | 17 | ################################################################################
|
18 | 18 |
|
19 |
| -forecast.Rcpp_bvarm <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),useMean=FALSE,back_data=0,save=FALSE,height=13,width=11,...){ |
20 |
| - return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,useMean,back_data,save,height,width) |
| 19 | +forecast.Rcpp_bvarm <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11,...) |
| 20 | +{ |
| 21 | + return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,use_mean,back_data,save,height,width) |
21 | 22 | }
|
22 | 23 |
|
23 |
| -forecast.Rcpp_bvars <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),useMean=FALSE,back_data=0,save=FALSE,height=13,width=11,...){ |
24 |
| - return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,useMean,back_data,save,height,width) |
| 24 | +forecast.Rcpp_bvars <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11,...) |
| 25 | +{ |
| 26 | + return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,use_mean,back_data,save,height,width) |
25 | 27 | }
|
26 | 28 |
|
27 |
| -forecast.Rcpp_bvarw <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),useMean=FALSE,back_data=0,save=FALSE,height=13,width=11,...){ |
28 |
| - return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,useMean,back_data,save,height,width) |
| 29 | +forecast.Rcpp_bvarw <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11,...) |
| 30 | +{ |
| 31 | + return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,use_mean,back_data,save,height,width) |
29 | 32 | }
|
30 | 33 |
|
31 |
| -forecast.Rcpp_cvar <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),useMean=FALSE,back_data=0,save=FALSE,height=13,width=11,...){ |
32 |
| - return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,useMean,back_data,save,height,width) |
| 34 | +forecast.Rcpp_cvar <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11,...) |
| 35 | +{ |
| 36 | + return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,use_mean,back_data,save,height,width) |
33 | 37 | }
|
34 | 38 |
|
35 |
| -forecast.Rcpp_dsge_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),useMean=FALSE,back_data=0,save=FALSE,height=13,width=11,...){ |
36 |
| - return=.forecast_dsge(obj,periods,shocks,plot,var_names,percentiles,useMean,back_data,save,height,width) |
| 39 | +forecast.Rcpp_dsge_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11,...) |
| 40 | +{ |
| 41 | + return=.forecast_dsge(obj,periods,shocks,plot,var_names,percentiles,use_mean,back_data,save,height,width) |
37 | 42 | }
|
38 | 43 |
|
39 |
| -forecast.Rcpp_dsgevar_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),useMean=FALSE,back_data=0,save=FALSE,height=13,width=11,...){ |
40 |
| - return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,useMean,back_data,save,height,width) |
| 44 | +forecast.Rcpp_dsge_uhlig <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11,...) |
| 45 | +{ |
| 46 | + return=.forecast_dsge(obj,periods,shocks,plot,var_names,percentiles,use_mean,back_data,save,height,width) |
41 | 47 | }
|
42 | 48 |
|
43 |
| -.forecast_var <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),useMean=FALSE,back_data=0,save=FALSE,height=13,width=11){ |
| 49 | +forecast.Rcpp_dsgevar_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11,...) |
| 50 | +{ |
| 51 | + return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,use_mean,back_data,save,height,width) |
| 52 | +} |
| 53 | + |
| 54 | +forecast.Rcpp_dsgevar_uhlig <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11,...) |
| 55 | +{ |
| 56 | + return=.forecast_var(obj,periods,shocks,plot,var_names,percentiles,use_mean,back_data,save,height,width) |
| 57 | +} |
| 58 | + |
| 59 | +# |
| 60 | + |
| 61 | +.forecast_var <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11){ |
44 | 62 |
|
45 | 63 | #if(getRversion() >= "3.1.0") utils::suppressForeignCheck(names=c("Time", "FCL", "FCU", "FCM"))
|
46 | 64 |
|
@@ -75,7 +93,7 @@ forecast.Rcpp_dsgevar_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,va
|
75 | 93 | for (i in 1:M) {
|
76 | 94 | FDataTemp <- 0
|
77 | 95 |
|
78 |
| - if (useMean == TRUE) { # Use the mean or middle percentile? |
| 96 | + if (use_mean == TRUE) { # Use the mean or middle percentile? |
79 | 97 | FDataTemp <- data.frame(forecast_sorted[,i,lower_conf],forecast_mean[,i],forecast_sorted[,i,upper_conf])
|
80 | 98 | } else {
|
81 | 99 | FDataTemp <- data.frame(forecast_sorted[,i,lower_conf],forecast_sorted[,i,mid_conf],forecast_sorted[,i,upper_conf])
|
@@ -146,7 +164,7 @@ forecast.Rcpp_dsgevar_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,va
|
146 | 164 | return=list(MeanForecast=forecast_mean,PointForecast=forecast_sorted[,,mid_conf])
|
147 | 165 | }
|
148 | 166 |
|
149 |
| -.forecast_dsge <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),useMean=FALSE,back_data=0,save=FALSE,height=13,width=11){ |
| 167 | +.forecast_dsge <- function(obj,periods=20,shocks=TRUE,plot=TRUE,var_names=NULL,percentiles=c(.05,.50,.95),use_mean=FALSE,back_data=0,save=FALSE,height=13,width=11){ |
150 | 168 |
|
151 | 169 | #if(getRversion() >= "3.1.0") utils::suppressForeignCheck(names=c("Time", "FCL", "FCU", "FCM"))
|
152 | 170 |
|
@@ -181,7 +199,7 @@ forecast.Rcpp_dsgevar_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,va
|
181 | 199 | for (i in 1:M) {
|
182 | 200 | FDataTemp <- 0
|
183 | 201 |
|
184 |
| - if (useMean == TRUE) { # Use the mean or middle percentile? |
| 202 | + if (use_mean == TRUE) { # Use the mean or middle percentile? |
185 | 203 | FDataTemp <- data.frame(forecast_sorted[,i,lower_conf],forecast_mean[,i],forecast_sorted[,i,upper_conf])
|
186 | 204 | } else {
|
187 | 205 | FDataTemp <- data.frame(forecast_sorted[,i,lower_conf],forecast_sorted[,i,mid_conf],forecast_sorted[,i,upper_conf])
|
|
0 commit comments