rot.eval {BGVAR} | R Documentation |
This function evaluates the log file that can be generated when identifying shocks with sign restrictions and using parallelization, probably on a server. The function has to be executed on a different R session than the one on which the the sign restriction search is executed (probably a local R session). It shows how many rotation matrices are found so far and how many tries it takes on average to find a suitable matrix. The output is printed to the (local) R console.
rot.eval(File)
File |
The path and file name of the log file created by |
tries
Numeric vector of nr. of draws it took to sample a valid rotation matrix.
Martin Feldkircher
IRF
.
# call this in R----------------------------------------------------------------------------------------------------------- #setwd("mydirectory") #library(BGVAR) #data(eerData) #model.ssvs.eer<-bgvar(Data=eer.data,W=W.trade0012,saves=1500,burns=500,plag=1,Cpu=1,prior="SSVS",save_thin=0.3,eigen=TRUE,trim=1.05) # estimate this on a cluster using multiple CPU cores #sign.constr.eer<-list() #sign.constr.eer$shock1$shock<-"US.y" # Positive AD Shock, gdp goes up, #sign.constr.eer$shock1$restrictions$res1<-"US.Dp" # inflation up and interest rates as well #sign.constr.eer$shock1$restrictions$res2<-"US.stir" #sign.constr.eer$shock1$sign<-c(">",">",">") #sign.constr.eer$shock1$rest.horz<-c(1,1,1) #sign.constr.eer$shock1$constr<-c(1,1,1) #sign.constr.eer$shock1$scal<-1 #+1% increase #rotSpec<-list();rotSpec$Srots<-1;rotSpec$MaxTries<-5000 #irf.sign<-IRF(gvar.obj=model.ssvs.eer,shockc=NULL,nhor=48,sign.constr=sign.constr.eer,rotSpec=rotSpec,cpu=2) # use at another (local) R session to infer about rotation sampling #rot.eval(File="/mydirectory/log.txt")