Skip to content

Commit 71827fd

Browse files
committed
v0.5.0
Update
1 parent a96e61c commit 71827fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+4908
-3574
lines changed

DESCRIPTION

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
Package: BMR
22
Title: Bayesian Macroeconometrics in R
3-
Version: 0.4.3
4-
Date: 2015-02-06
3+
Version: 0.5.0
4+
Date: 2015-07-20
55
Author: Keith O'Hara
66
Maintainer: Keith O'Hara <[email protected]>
77
Description: A package for estimating Bayesian macroeconometric models.
8-
License: GPL-3
9-
Depends: Rcpp (>= 0.11.4), RcppArmadillo (>= 0.4.6.4.0), doSNOW (>= 1.0.12), ggplot2 (>= 1.0.0), grid
10-
LinkingTo: Rcpp, RcppArmadillo, doSNOW, ggplot2, grid
8+
License: GPL (>=2)
9+
Depends: Rcpp (>= 0.11.4), RcppArmadillo (>= 0.4.6.4.0), doSNOW (>= 1.0.12), ggplot2 (>= 1.0.0)
10+
LinkingTo: Rcpp, RcppArmadillo
11+
Imports: foreach, snow, grid

LICENSE

Lines changed: 285 additions & 620 deletions
Large diffs are not rendered by default.

NAMESPACE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
useDynLib(BMR)
2+
3+
importFrom(Rcpp, evalCpp)
4+
import(RcppArmadillo)
5+
import(doSNOW)
6+
import(foreach)
7+
importFrom(snow, makeCluster, stopCluster)
8+
import(ggplot2)
9+
importFrom(grid, grid.newpage, viewport, pushViewport, grid.layout)
10+
211
exportPattern("^[[:alpha:]]+")

R/AutocorrelationFunctions.R

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
1+
################################################################################
2+
##
3+
## R package BMR by Keith O'Hara Copyright (C) 2011, 2012, 2013, 2014, 2015
4+
## This file is part of the R package BMR.
5+
##
6+
## The R package BMR is free software: you can redistribute it and/or modify
7+
## it under the terms of the GNU General Public License as published by
8+
## the Free Software Foundation, either version 2 of the License, or
9+
## (at your option) any later version.
10+
##
11+
## The R package BMR is distributed in the hope that it will be useful,
12+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
## GNU General Public License for more details.
15+
##
16+
################################################################################
17+
18+
# 07/20/2015
19+
120
gacf<-function(y,lags=10,ci=.95,plot=TRUE,barcolor="purple",names=FALSE,save=FALSE,height=12,width=12){
221
.ggplotacf(y,lags,ci,plot,barcolor,names,save,height,width)
322
}
423

5-
gpacf<-function(y,lags=10,ci=.95,plot=T,barcolor="darkred",names=FALSE,save=FALSE,height=12,width=12){
24+
gpacf<-function(y,lags=10,ci=.95,plot=TRUE,barcolor="darkred",names=FALSE,save=FALSE,height=12,width=12){
625
.ggplotpacf(y,lags,ci,plot,barcolor,names,save,height,width)
726
}
827

9-
.ggplotacf<-function(y,lags=10,ci=.95,plot=T,barcolor="purple",names=FALSE,save=FALSE,height=12,width=12){
28+
.ggplotacf<-function(y,lags=10,ci=.95,plot=TRUE,barcolor="purple",names=FALSE,save=FALSE,height=12,width=12){
1029
#
1130
M <- as.numeric(ncol(y))
1231
#
@@ -23,7 +42,7 @@ gpacf<-function(y,lags=10,ci=.95,plot=T,barcolor="darkred",names=FALSE,save=FALS
2342
}
2443
#
2544
for(j in 1:M){
26-
myacf <- acf(y[,j],lags,plot=F)
45+
myacf <- acf(y[,j],lags,plot=FALSE)
2746
myacf2 <- as.numeric(myacf$acf)
2847
myacf2 <- myacf2[2:(lags+1)]
2948
ACFMat[,j] <- myacf2
@@ -40,7 +59,7 @@ gpacf<-function(y,lags=10,ci=.95,plot=T,barcolor="darkred",names=FALSE,save=FALS
4059
if(plot==TRUE){
4160
if(save==TRUE){
4261
if(class(dev.list()) != "NULL"){dev.off()}
43-
cairo_ps(file="ACF.eps",height=height,width=width)
62+
cairo_ps(filename="ACF.eps",height=height,width=width)
4463
}else{
4564
grid.newpage()
4665
}
@@ -76,7 +95,7 @@ gpacf<-function(y,lags=10,ci=.95,plot=T,barcolor="darkred",names=FALSE,save=FALS
7695
#
7796
}
7897

79-
.ggplotpacf<-function(y,lags=10,ci=.95,plot=T,barcolor="darkred",names=FALSE,save=FALSE,height=12,width=12){
98+
.ggplotpacf<-function(y,lags=10,ci=.95,plot=TRUE,barcolor="darkred",names=FALSE,save=FALSE,height=12,width=12){
8099
#
81100
M <- as.numeric(ncol(y))
82101
#
@@ -93,7 +112,7 @@ gpacf<-function(y,lags=10,ci=.95,plot=T,barcolor="darkred",names=FALSE,save=FALS
93112
}
94113
#
95114
for(j in 1:M){
96-
mypacf <- pacf(y[,j],lags,plot=F)
115+
mypacf <- pacf(y[,j],lags,plot=FALSE)
97116
mypacf2 <- as.numeric(mypacf$acf)
98117
mypacf2 <- mypacf2[1:lags]
99118
PACFMat[,j] <- mypacf2
@@ -110,7 +129,7 @@ gpacf<-function(y,lags=10,ci=.95,plot=T,barcolor="darkred",names=FALSE,save=FALS
110129
if(plot==TRUE){
111130
if(save==TRUE){
112131
if(class(dev.list()) != "NULL"){dev.off()}
113-
cairo_ps(file="PACF.eps",height=height,width=width)
132+
cairo_ps(filename="PACF.eps",height=height,width=width)
114133
}else{
115134
grid.newpage()
116135
}

R/BVARM.R

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# 01/12/2015
1+
################################################################################
2+
##
3+
## R package BMR by Keith O'Hara Copyright (C) 2011, 2012, 2013, 2014, 2015
4+
## This file is part of the R package BMR.
5+
##
6+
## The R package BMR is free software: you can redistribute it and/or modify
7+
## it under the terms of the GNU General Public License as published by
8+
## the Free Software Foundation, either version 2 of the License, or
9+
## (at your option) any later version.
10+
##
11+
## The R package BMR is distributed in the hope that it will be useful,
12+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
## GNU General Public License for more details.
15+
##
16+
################################################################################
17+
18+
# 07/20/2015
19+
220
BVARM.default <- function(mydata,coefprior=NULL,p=4,constant=TRUE,irf.periods=20,keep=10000,burnin=1000,VType=1,decay="H",HP1=0.5,HP2=0.5,HP3=1,HP4=2){
321
#
422
kerr <- .bvarmerrors(mydata,p,coefprior,constant,VType,decay,HP4)
@@ -188,11 +206,11 @@ BVARM.default <- function(mydata,coefprior=NULL,p=4,constant=TRUE,irf.periods=20
188206
Sigma <- kronecker(solve(Sigma),diag(nrow(Y)))
189207
#
190208
message('Starting Gibbs C++, ', date(),'.', sep="")
191-
RepsRun <- .Call("MBVARReps", Sigma,as.matrix(Z),as.matrix(Y),matrix(aPr,ncol=1),BVPr,M,K,burnin,keep, PACKAGE = "BMR", DUP = FALSE)
209+
RepsRun <- .Call("MBVARReps", Sigma,as.matrix(Z),as.matrix(Y),matrix(aPr,ncol=1),BVPr,M,K,burnin,keep, PACKAGE = "BMR")
192210
message('C++ reps finished, ', date(),'. Now generating IRFs.', sep="")
193211
#
194212
kcons <- 0; if(constant==T){kcons<-1}
195-
ImpStore <- .Call("MBVARIRFs", shock,M,K,kcons,keep,irf.periods,RepsRun$Beta, PACKAGE = "BMR", DUP = FALSE)
213+
ImpStore <- .Call("MBVARIRFs", shock,M,K,kcons,keep,irf.periods,RepsRun$Beta, PACKAGE = "BMR")
196214
ImpStore <- ImpStore$ImpStore
197215
ImpStore2 <- array(NA,dim=c(M,M,irf.periods,keep))
198216
for(i in 1:keep){

R/BVARS.R

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# 01/12/2015
1+
################################################################################
2+
##
3+
## R package BMR by Keith O'Hara Copyright (C) 2011, 2012, 2013, 2014, 2015
4+
## This file is part of the R package BMR.
5+
##
6+
## The R package BMR is free software: you can redistribute it and/or modify
7+
## it under the terms of the GNU General Public License as published by
8+
## the Free Software Foundation, either version 2 of the License, or
9+
## (at your option) any later version.
10+
##
11+
## The R package BMR is distributed in the hope that it will be useful,
12+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
## GNU General Public License for more details.
15+
##
16+
################################################################################
17+
18+
# 07/20/2015
19+
220
BVARS.default <- function(mydata,psiprior=NULL,coefprior=NULL,p=4,irf.periods=20,keep=10000,burnin=1000,XiPsi=1,HP1=0.5,HP4=2,gamma=NULL){
321
#
422
kerr <- .bvarserrors(mydata,p,coefprior,psiprior,XiPsi,HP1,HP4,gamma)
@@ -158,10 +176,10 @@ BVARS.default <- function(mydata,psiprior=NULL,coefprior=NULL,p=4,irf.periods=20
158176
ImpStore <- 0
159177
#
160178
message('Starting Gibbs C++, ', date(),'.', sep="")
161-
RepsRun <- .Call("SBVARReps", as.matrix(X),as.matrix(Y),d,dX,yd,Zd,PsiPr,invPsiVPr,BPr,Beta,invBVPr,Sigma,SigmaML,gamma,Tp,M,p,burnin,keep, PACKAGE = "BMR", DUP = FALSE)
179+
RepsRun <- .Call("SBVARReps", as.matrix(X),as.matrix(Y),d,dX,yd,Zd,PsiPr,invPsiVPr,BPr,Beta,invBVPr,Sigma,SigmaML,gamma,Tp,M,p,burnin,keep, PACKAGE = "BMR")
162180
message('C++ reps finished, ', date(),'. Now generating IRFs.', sep="")
163181
#
164-
ImpStore <- .Call("SBVARIRFs", M,K,keep,irf.periods,RepsRun$Beta,RepsRun$Sigma, PACKAGE = "BMR", DUP = FALSE)
182+
ImpStore <- .Call("SBVARIRFs", M,K,keep,irf.periods,RepsRun$Beta,RepsRun$Sigma, PACKAGE = "BMR")
165183
#
166184
ImpStore <- ImpStore$ImpStore
167185
ImpStore2 <- array(NA,dim=c(M,M,irf.periods,keep))

R/BVARTVP.R

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# 01/12/2015
1+
################################################################################
2+
##
3+
## R package BMR by Keith O'Hara Copyright (C) 2011, 2012, 2013, 2014, 2015
4+
## This file is part of the R package BMR.
5+
##
6+
## The R package BMR is free software: you can redistribute it and/or modify
7+
## it under the terms of the GNU General Public License as published by
8+
## the Free Software Foundation, either version 2 of the License, or
9+
## (at your option) any later version.
10+
##
11+
## The R package BMR is distributed in the hope that it will be useful,
12+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
## GNU General Public License for more details.
15+
##
16+
################################################################################
17+
18+
# 07/20/2015
19+
220
BVARTVP.default <- function(mydata,timelab=NULL,coefprior=NULL,tau=NULL,p=4,irf.periods=20,irf.points=NULL,keep=10000,burnin=5000,XiBeta=1,XiQ=0.01,gammaQ=NULL,XiSigma=1,gammaS=NULL){
321
#
422
kerr <- .bvartvperror(mydata,p,coefprior,tau,XiBeta,XiQ,gammaQ,XiSigma,gammaS)
@@ -12,7 +30,7 @@ BVARTVP.default <- function(mydata,timelab=NULL,coefprior=NULL,tau=NULL,p=4,irf.
1230
kreps <- .bvartvpreps(kdata$Y,kdata$y,kdata$Z,kprior$B0Pr,kprior$B0VPr,kprior$invB0VPr,
1331
kprior$QPr,kprior$QVPr,kprior$SPr,kprior$SVPr,kprior$QDraw,kprior$Qchol,
1432
kprior$SDraw,kprior$invSDraw,kdata$K,kdata$M,p,kdata$kT,
15-
keep,burnin,kdata$timelab,kdata$nIRFs,kdata$irf.points,cumulative,irf.periods)
33+
keep,burnin,kdata$timelab,kdata$nIRFs,kdata$irf.points,irf.periods)
1634
#
1735
bvartvpret <- list(IRFs=kreps$IRFs,Beta=kreps$BetaMean,Q=kreps$QMean,Sigma=kreps$SigmaMean,BDraws=kreps$Betas,QDraws=kreps$QDraws,SDraws=kreps$SDraws,data=mydata,irf.points=irf.points,tau=tau)
1836
class(bvartvpret) <- "BVARTVP"
@@ -165,7 +183,7 @@ BVARTVP.default <- function(mydata,timelab=NULL,coefprior=NULL,tau=NULL,p=4,irf.
165183
SPr <- 0; SVPr <- 0; SDraw <- 0; invSDraw <- 0
166184
#
167185
if(class(tau)!="NULL"){
168-
TauSamplingRun <- .Call("tsprior", Y,tau,M,K,p, PACKAGE = "BMR", DUP = FALSE)
186+
TauSamplingRun <- .Call("tsprior", Y,tau,M,K,p, PACKAGE = "BMR")
169187
#
170188
BetaVariance <- TauSamplingRun$BVPrOLS
171189
#
@@ -206,7 +224,7 @@ BVARTVP.default <- function(mydata,timelab=NULL,coefprior=NULL,tau=NULL,p=4,irf.
206224
}
207225
QSortIndex <- c(QSortIndex)
208226
#
209-
BPr <- c(t(ktest1))[c(t(QSortIndex))]
227+
BPr <- c(t(BPr))[c(t(QSortIndex))]
210228
B0Pr <- matrix(BPr,ncol=1)
211229
#
212230
if(class(XiBeta)=="numeric"){
@@ -232,10 +250,10 @@ BVARTVP.default <- function(mydata,timelab=NULL,coefprior=NULL,tau=NULL,p=4,irf.
232250
return=list(B0Pr=B0Pr,B0VPr=B0VPr,invB0VPr=invB0VPr,QPr=QPr,QVPr=QVPr,SPr=SPr,SVPr=SVPr,QDraw=QDraw,Qchol=Qchol,SDraw=SDraw,invSDraw=invSDraw)
233251
}
234252

235-
.bvartvpreps <- function(Y,y,Z,B0Pr,B0VPr,invB0VPr,QPr,QVPr,SPr,SVPr,QDraw,Qchol,SDraw,invSDraw,K,M,p,kT,keep,burnin,timelab,nIRFs,irf.points,cumulative,irf.periods){
253+
.bvartvpreps <- function(Y,y,Z,B0Pr,B0VPr,invB0VPr,QPr,QVPr,SPr,SVPr,QDraw,Qchol,SDraw,invSDraw,K,M,p,kT,keep,burnin,timelab,nIRFs,irf.points,irf.periods){
236254
#
237255
message('Starting Gibbs C++, ', date(),'.', sep="")
238-
RepsRun <- .Call("BVARTVPReps", y,Z,M,K,kT,keep,burnin,B0Pr,B0VPr,invB0VPr,QPr,QVPr,SPr,SVPr,QDraw,Qchol,SDraw,invSDraw, PACKAGE = "BMR", DUP = FALSE)
256+
RepsRun <- .Call("BVARTVPReps", y,Z,M,K,kT,keep,burnin,B0Pr,B0VPr,invB0VPr,QPr,QVPr,SPr,SVPr,QDraw,Qchol,SDraw,invSDraw, PACKAGE = "BMR")
239257
message('C++ reps finished, ', date(),'. Now generating IRFs.', sep="")
240258
#
241259
BetaDraws <- RepsRun$BetaDraws; QDraws <- RepsRun$QDraws; SDraws <- RepsRun$SDraws
@@ -281,7 +299,7 @@ BVARTVP.default <- function(mydata,timelab=NULL,coefprior=NULL,tau=NULL,p=4,irf.
281299
if(KTC < (nIRFs+1)){
282300
if(timelab[i] == irf.points[KTC]){
283301
Beta <- BetaT[,,,i]
284-
ImpStore <- .Call("BVARTVPIRFs", M,K/M,keep,irf.periods,Beta,SDraws, PACKAGE = "BMR", DUP = FALSE)
302+
ImpStore <- .Call("BVARTVPIRFs", M,K/M,keep,irf.periods,Beta,SDraws, PACKAGE = "BMR")
285303
ImpStore <- ImpStore$ImpStore
286304
ImpStoreE <- array(NA,dim=c(M,M,irf.periods,keep))
287305
for(j in 1:keep){

R/BVARW.R

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# 01/12/2015
1+
################################################################################
2+
##
3+
## R package BMR by Keith O'Hara Copyright (C) 2011, 2012, 2013, 2014, 2015
4+
## This file is part of the R package BMR.
5+
##
6+
## The R package BMR is free software: you can redistribute it and/or modify
7+
## it under the terms of the GNU General Public License as published by
8+
## the Free Software Foundation, either version 2 of the License, or
9+
## (at your option) any later version.
10+
##
11+
## The R package BMR is distributed in the hope that it will be useful,
12+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
## GNU General Public License for more details.
15+
##
16+
################################################################################
17+
18+
# 07/20/2015
19+
220
BVARW.default <- function(mydata,cores=1,coefprior=NULL,p=4,constant=TRUE,irf.periods=20,keep=10000,burnin=1000,XiBeta=1,XiSigma=1,gamma=NULL){
321
#
422
kerr <- .bvarwerrors(mydata,cores,p,coefprior,constant,XiBeta,XiSigma,gamma)
@@ -167,11 +185,11 @@ BVARW.default <- function(mydata,cores=1,coefprior=NULL,p=4,constant=TRUE,irf.pe
167185
ImpStore <- 0
168186
#
169187
message('Starting Gibbs C++, ', date(),'.', sep="")
170-
RepsRun <- .Call("WBVARReps", Sigma,as.matrix(X),as.matrix(Z),as.matrix(Y),matrix(aPr,ncol=1),SPr,vPr,BVPr,Tp,M,K,burnin,keep, PACKAGE = "BMR", DUP = FALSE)
188+
RepsRun <- .Call("WBVARReps", Sigma,as.matrix(X),as.matrix(Z),as.matrix(Y),matrix(aPr,ncol=1),SPr,vPr,BVPr,Tp,M,K,burnin,keep, PACKAGE = "BMR")
171189
message('C++ reps finished, ', date(),'. Now generating IRFs.', sep="")
172190
#
173191
kcons <- 0; if(constant==T){kcons<-1}
174-
ImpStore <- .Call("WBVARIRFs", M,K,kcons,keep,irf.periods,RepsRun$Beta,RepsRun$Sigma, PACKAGE = "BMR", DUP = FALSE)
192+
ImpStore <- .Call("WBVARIRFs", M,K,kcons,keep,irf.periods,RepsRun$Beta,RepsRun$Sigma, PACKAGE = "BMR")
175193
ImpStore <- ImpStore$ImpStore
176194
IRFStore <- array(NA,dim=c(M,M,irf.periods,keep))
177195
for(i in 1:keep){
@@ -208,7 +226,7 @@ BVARW.default <- function(mydata,cores=1,coefprior=NULL,p=4,constant=TRUE,irf.pe
208226
#
209227
message('Starting Gibbs C++, ', date(),'.', sep="")
210228
#
211-
RepsRunB <- .Call("WBVARRepsB", Sigma,as.matrix(X),as.matrix(Z),as.matrix(Y),matrix(aPr,ncol=1),SPr,vPr,BVPr,Tp,M,K,burnin, PACKAGE = "BMR", DUP = FALSE)
229+
RepsRunB <- .Call("WBVARRepsB", Sigma,as.matrix(X),as.matrix(Z),as.matrix(Y),matrix(aPr,ncol=1),SPr,vPr,BVPr,Tp,M,K,burnin, PACKAGE = "BMR")
212230
#
213231
cl <- makeCluster(NCore)
214232
registerDoSNOW(cl)
@@ -232,7 +250,7 @@ BVARW.default <- function(mydata,cores=1,coefprior=NULL,p=4,constant=TRUE,irf.pe
232250
message('C++ reps finished, ', date(),'. Now generating IRFs.', sep="")
233251
#
234252
kcons <- 0; if(constant==T){kcons<-1}
235-
ImpStore <- .Call("WBVARIRFs", M,K,kcons,keep,irf.periods,BetaArray,SigmaArray, PACKAGE = "BMR", DUP = FALSE)
253+
ImpStore <- .Call("WBVARIRFs", M,K,kcons,keep,irf.periods,BetaArray,SigmaArray, PACKAGE = "BMR")
236254
ImpStore <- ImpStore$ImpStore
237255
IRFStore <- array(NA,dim=c(M,M,irf.periods,keep))
238256
for(i in 1:keep){
@@ -265,7 +283,7 @@ BVARW.default <- function(mydata,cores=1,coefprior=NULL,p=4,constant=TRUE,irf.pe
265283

266284
.RepsBFn <- function(Sigma,X,Z,Y,aPr,SPr,vPr,BVPr,Tp,M,K,keeppar){
267285
#
268-
Res <- .Call("WBVARRepsK", Sigma,X,Z,Y,aPr,SPr,vPr,BVPr,Tp,M,K,keeppar, PACKAGE = "BMR", DUP = FALSE)
286+
Res <- .Call("WBVARRepsK", Sigma,X,Z,Y,aPr,SPr,vPr,BVPr,Tp,M,K,keeppar, PACKAGE = "BMR")
269287
#
270288
return(list(Res$Beta,Res$Sigma))
271289
}

R/CVAR.R

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1-
# 01/12/2014
1+
################################################################################
2+
##
3+
## R package BMR by Keith O'Hara Copyright (C) 2011, 2012, 2013, 2014, 2015
4+
## This file is part of the R package BMR.
5+
##
6+
## The R package BMR is free software: you can redistribute it and/or modify
7+
## it under the terms of the GNU General Public License as published by
8+
## the Free Software Foundation, either version 2 of the License, or
9+
## (at your option) any later version.
10+
##
11+
## The R package BMR is distributed in the hope that it will be useful,
12+
## but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
## GNU General Public License for more details.
15+
##
16+
################################################################################
17+
18+
# 07/20/2015
19+
220
CVAR.default <- function(mydata,p=4,constant=TRUE,irf.periods=20,boot=10000){
321
#
422
kerr <- .cvarerrors(mydata,p)
@@ -72,10 +90,10 @@ CVAR.default <- function(mydata,p=4,constant=TRUE,irf.periods=20,boot=10000){
7290
kcons <- 0; if(constant==T){kcons<-1}
7391
#
7492
message('Starting C++, ', date(),'.', sep="")
75-
RepsRun <- .Call("CVARReps", Beta,Sigma,as.matrix(X),as.matrix(Y),Tp,M,K,kcons,boot,ResidDraws, PACKAGE = "BMR", DUP = FALSE)
93+
RepsRun <- .Call("CVARReps", Beta,Sigma,as.matrix(X),as.matrix(Y),Tp,M,K,kcons,boot,ResidDraws, PACKAGE = "BMR")
7694
message('C++ reps finished, ', date(),'. Now getting IRFs.', sep="")
7795
#
78-
ImpStore <- .Call("CVARIRFs", M,K,kcons,boot,irf.periods,RepsRun$Beta,RepsRun$Sigma, PACKAGE = "BMR", DUP = FALSE)
96+
ImpStore <- .Call("CVARIRFs", M,K,kcons,boot,irf.periods,RepsRun$Beta,RepsRun$Sigma, PACKAGE = "BMR")
7997
ImpStore <- ImpStore$ImpStore
8098
ImpStore2 <- array(NA,dim=c(M,M,irf.periods,boot))
8199
for(i in 1:boot){

0 commit comments

Comments
 (0)