Description Usage Arguments Details Value Note Author(s) References See Also Examples
Estimates Fry and Pagan's (2011) median target impulse responses
1 2 3 |
Y |
A ts object containing the data series used for estimation; this should be of size T x nvar. |
irfdraws |
A draws x steps x nvar array of posterior impulse responses. |
nlags |
The number of lags to include of each variable. This should correspond to the number used to generate |
constant |
A logical statement on whether to include an intercept in the model. This should correspond to the value used to generate |
type |
A string, either "median" or "mean" response, specifying the type of response to be plotted. This should correspond to the value used to generate |
labels |
A list of variable labels for impulse response plots, The default are the variable names of the model handed over by colnames(Y). |
target |
A logical statement on whether to include the target impulse response, specified in |
save |
A logical statement to save the graph in the current working directory. The default is 'FALSE'. |
legend |
A logical statement on whether or not to generate a legend at the bottom of the graph. The default is 'TRUE'. |
bands |
A list of length 2 containing the error bands of the impulse responses. If bands='NULL', only IRFs are plotted. The default is c(0.16, 0.84). |
grid |
A logical statement on whether or not to generate grid lines in the plots. The default is 'TRUE'. |
bw |
A logical statement on whether or not to generate black and white or colour graphs. The default is 'FALSE'. |
maxit |
An integer value for the maximum number of iterations of the minimisation routine. The default value is 1000. |
This function estimates the Fry and Pagan's (2011) median target impulse responses and plots the resulting impulse responses with error bands. The function evaluates the output of a sign restricted model specified in irfdraws
, by finding the single response and impulse vector that comes closest to the target impulse response specified in type
. The error bands correspond to the model that has generated irfdraws
.
The function returns a plot of the median target responses with user-selected percentiles.
Users should consult the reference papers and the package vignette for more information.
Christian Danne
Fry, R. and Pagan, A. (2011), "Sign restrictions in structural vector autoregressions: A critical review", Journal of Economic Literature, 49, 938-960.
rfbvar
, uhlig.reject
, uhlig.penalty
, rwz.reject
, irfplot
, fevdplot
.
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 | ## Not run:
# Replication of Figure 6 of Uhlig (2005)
set.seed(12345)
data(uhligdata)
# variable labels for plots
vl <- c("GDP","GDP Deflator","Comm.Pr.Index","Fed Funds Rate",
"NB Reserves", "Total Reserves")
# sign restrictions
constr <- c(+4,-3,-2,-5)
# estimates the model
model1 <- uhlig.reject(Y=uhligdata, nlags=12, draws=200, subdraws=200, nkeep=1000,
KMIN=1, KMAX=6, constrained=constr, constant=FALSE, steps=60)
# get posterior draws
irfs1 <- model1$IRFS
# estimate Fry and Pagan's MT method
fp.target(Y=uhligdata, nlags=12, irfdraws=irfs1, constant=F, type="median",
labels=vl, target= TRUE, save=FALSE, legend=TRUE,
bands=c(0.16, 0.84), grid=TRUE, bw=FALSE, maxit=1000)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.