Skip to content

Commit bc465d1

Browse files
committed
update
1 parent 2229269 commit bc465d1

35 files changed

+649
-596
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@
55
.vscode
66
LICENSE
77
README.md
8+
^.*\.Rproj$
9+
^\.Rproj\.user$

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.Rproj.user
1+
*.Rproj*
22
.Rhistory
33
*.o
44
*.so

NAMESPACE

Lines changed: 3 additions & 3 deletions
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,modecheck,prior,stationarity,gtsplot,gacf,gpacf)
19+
export(IRF,forecast,mode_check,prior,stationarity,gtsplot,gacf,gpacf)
2020

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

@@ -32,5 +32,5 @@ S3method(forecast, Rcpp_bvars)
3232
S3method(forecast, Rcpp_bvarw)
3333
S3method(forecast, Rcpp_cvar)
3434

35-
S3method(modecheck, Rcpp_dsge_gensys)
36-
S3method(modecheck, Rcpp_dsgevar_gensys)
35+
S3method(mode_check, Rcpp_dsge_gensys)
36+
S3method(mode_check, Rcpp_dsgevar_gensys)

R/Classes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@
1919
forecast <- function(obj, ...) UseMethod("forecast")
2020
IRF <- function(obj, ...) UseMethod("IRF")
2121

22-
modecheck <- function(obj, ...) UseMethod("modecheck")
22+
mode_check <- function(obj, ...) UseMethod("mode_check")
2323
states <- function(obj, ...) UseMethod("states")

R/Forecast.R

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,33 @@
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

3735
forecast.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

4240
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,...){
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

Comments
 (0)