Skip to content

Commit 73d158a

Browse files
committed
update
1 parent 975d61d commit 73d158a

32 files changed

+1200
-990
lines changed

DESCRIPTION

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
Package: BMR
22
Type: Package
33
Title: Bayesian Macroeconometrics in R
4-
Version: 0.9.0
5-
Date: 2017-09-10
4+
Version: 0.9.1
5+
Date: 2017-09-17
66
Author: Keith O'Hara <[email protected]>
77
Maintainer: Keith O'Hara <[email protected]>
88
Description: A package for estimating Bayesian macroeconometric models.
99
License: GPL (>=2)
1010
Depends:
11-
R (>= 3.3.0),
11+
R (>= 3.4.0),
1212
Rcpp (>= 0.12.2),
1313
ggplot2 (>= 1.0.0)
14-
LinkingTo: Rcpp, RcppArmadillo (>= 0.6.400.2)
14+
LinkingTo: Rcpp, RcppArmadillo (>= 0.7.960.0)
1515
Imports:
1616
methods,
1717
Rcpp,
1818
grid
1919
NeedsCompilation: yes
2020
RcppModules: bvarm_module, bvars_module, bvarw_module, bvartvp_module, cvar_module,
2121
gensys_module, uhlig_module,
22-
dsge_gensys_module,
23-
dsgevar_gensys_module
22+
dsge_gensys_module, dsge_uhlig_module,
23+
dsgevar_gensys_module, dsgevar_uhlig_module

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ exportClasses("Rcpp_uhlig")
1616
exportClasses("Rcpp_dsge_gensys")
1717
exportClasses("Rcpp_dsgevar_gensys")
1818

19-
export(IRF,forecast,mode_check,prior,stationarity,gtsplot,gacf,gpacf)
19+
export(IRF,forecast,mode_check,prior,gtsplot)
2020

2121
exportPattern("^[[:alpha:]]+")
2222

R/Forecast.R

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,49 @@
1616
##
1717
################################################################################
1818

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)
2122
}
2223

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)
2527
}
2628

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)
2932
}
3033

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)
3337
}
3438

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)
3742
}
3843

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)
4147
}
4248

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){
4462

4563
#if(getRversion() >= "3.1.0") utils::suppressForeignCheck(names=c("Time", "FCL", "FCU", "FCM"))
4664

@@ -75,7 +93,7 @@ forecast.Rcpp_dsgevar_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,va
7593
for (i in 1:M) {
7694
FDataTemp <- 0
7795

78-
if (useMean == TRUE) { # Use the mean or middle percentile?
96+
if (use_mean == TRUE) { # Use the mean or middle percentile?
7997
FDataTemp <- data.frame(forecast_sorted[,i,lower_conf],forecast_mean[,i],forecast_sorted[,i,upper_conf])
8098
} else {
8199
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
146164
return=list(MeanForecast=forecast_mean,PointForecast=forecast_sorted[,,mid_conf])
147165
}
148166

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){
150168

151169
#if(getRversion() >= "3.1.0") utils::suppressForeignCheck(names=c("Time", "FCL", "FCU", "FCM"))
152170

@@ -181,7 +199,7 @@ forecast.Rcpp_dsgevar_gensys <- function(obj,periods=20,shocks=TRUE,plot=TRUE,va
181199
for (i in 1:M) {
182200
FDataTemp <- 0
183201

184-
if (useMean == TRUE) { # Use the mean or middle percentile?
202+
if (use_mean == TRUE) { # Use the mean or middle percentile?
185203
FDataTemp <- data.frame(forecast_sorted[,i,lower_conf],forecast_mean[,i],forecast_sorted[,i,upper_conf])
186204
} else {
187205
FDataTemp <- data.frame(forecast_sorted[,i,lower_conf],forecast_sorted[,i,mid_conf],forecast_sorted[,i,upper_conf])

0 commit comments

Comments
 (0)