pretty_irf | R Documentation |
Estimates the asymptotic covariance matrix
pretty_irf( data, shock_names, pretty_names = NULL, cum = F, confidence_type = "msw", manual_color = NULL, legend = F, title = NULL, same_scale = T, shock_sign = "positive" )
data |
list of var$irf objects from SVARIV |
shock_names |
instrument names |
pretty_names |
vector of pretty names for y-axis |
cum |
logical. Cumulative? BEWARE: Possible mistake here |
confidence_type |
vector of confidence types |
manual_color |
specify colors per Instrument. Input is a named vecor with shock_names and the corresponding color (hex) |
legend |
logical. inculde or exclude legends |
title |
vector of headings for each column |
same_scale |
logical value. Should all columns use the same scale? |
ggplot wrapper
p = 24 #Number of lags in the VAR model confidence = confidence=c(0.6,0.9,0.95) #Confidence Level for the standard and weak-IV robust confidence set NWlags = 0; # Newey-West lags(set it to 0 to compute heteroskedasticity robust std errors) norm = 1; # Variable used for normalization scale = 1; # Scale of the shock horizons = 20; #Number of horizons for the Impulse Response Functions(IRFs) colnames(oil)<-c("a","b","c","d","year","month") ydata<-oil[,1:3] z<-oil[,4] VAR<-SVARIV(ydata,z,p,confidence,NWlags,norm,scale,horizons,instrument_name="test") sh.col<- c("#E41A1C") names(sh.col)<-c("test") pretty_irf(data=list(VAR$irfs),shock_names="test",pretty_names=c("a","b","c"),manual_color=sh.col,title="subheading")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.