IRF: Plotting IRFs.

Description Usage Arguments Details Value Author(s) Examples

View source: R/Classes.R

Description

A function for plotting impulse response funtions using ggplot2.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  IRF(obj,...)

  ## S3 method for class 'bvarm'
IRF(obj,percentiles=c(.05,.50,.95),which_shock=NULL,which_response=NULL,save=FALSE,height=13,width=13,...)
  ## S3 method for class 'bvars'
IRF(obj,percentiles=c(.05,.50,.95),save=FALSE,height=13,width=13,...)
  ## S3 method for class 'bvarw'
IRF(obj,percentiles=c(.05,.50,.95),save=FALSE,height=13,width=13,...)
  ## S3 method for class 'cvar'
IRF(obj,percentiles=c(.05,.50,.95),save=FALSE,height=13,width=13,...)

  ## S3 method for class 'bvartvp'
IRF(obj,whichirfs=NULL,percentiles=c(.05,.50,.95),
  save=FALSE,height=13,width=13,...)
    
  ## S3 method for class 'DSGEVAR'
IRF(obj,var_names=NULL,percentiles=c(.05,.50,.95),comparison=TRUE,
    save=FALSE,height=13,width=13,...)
  ## S3 method for class 'EDSGE'
IRF(obj,observableIRFs=FALSE,var_names=NULL,percentiles=c(.05,.50,.95),
    save=FALSE,height=13,width=13,...)

  ## S3 method for class 'gensys'
IRF(obj,shocks,irf.periods=20,var_names=NULL,
    plot=TRUE,save=FALSE,height=13,width=13,...)
  ## S3 method for class 'uhlig'
IRF(obj,shocks,irf.periods=20,var_names=NULL,
    plot=TRUE,save=FALSE,height=13,width=13,...)
  ## S3 method for class 'SDSGE'
IRF(obj,shocks,irf.periods=20,var_names=NULL,
    plot=TRUE,save=FALSE,height=13,width=13,...)

Arguments

For objects of class ‘bvarm’, ‘bvars’, ‘bvarw’, or ‘cvar’,

obj

An object of the above class.

percentiles

The percentiles of the distribution the user wants to use.

save

Whether to save the plots.

height

If save=FALSE, use this to set the height of the plot.

width

If save=FALSE, use this to set the width of the plot.


For objects of class ‘bvartvp’,

whichirfs

Which IRFs to plot. (The default is to plot all of the IRFs contained in the estimation object.)


For objects of class ‘DSGEVAR’,

var_names

A character vector with the names of the relevant variables.

comparison

Whether to plot corresponding DSGE model IRFs.


For objects of class ‘EDSGE’,

observableIRFs

Whether to plot the IRFs relating to the state variables, or the implied IRFs of the observable series.


For objects of class ‘gensys’, ‘uhlig’, or ‘SDSGE’,

shocks

A numeric vector containing the standard deviations of the shocks.

irf.periods

The horizon of the IRFs.

plot

Whether to plot the IRFs.


...

Additional arguments (not used).

Details

This function will work with any estimated VAR model, estimated DSGE or DSGE-VAR model, or solved DSGE model.

Value

The function returns a plot of the IRFs with user-selected percentiles.

Author(s)

Keith O'Hara

Examples

1
2
3
4
5
6
7
8
## Not run: 
data(BMRVARData)
testbvarw <- bvarw(USMacroData[,2:4],c(0.9,0.95,0.95),p=4,constant=T,
                    irf.periods=20,keep=10000,burnin=5000,
                    XiBeta=4,XiSigma=1,gamma=4)
IRF(testbvarw,percentiles=c(0.05,0.5,0.95),save=FALSE)

## End(Not run)

kthohr/BMR documentation built on May 20, 2019, 7:04 p.m.