Learn R Programming

VARsignR (version 0.1.3)

fp.target: Fry and Pagan's (2011) median target method

Description

Estimates Fry and Pagan's (2011) median target impulse responses

Usage

fp.target(Y=NULL, irfdraws=NULL, nlags=4, constant=TRUE, type="median", labels=colnames(Y), target= TRUE, save=FALSE, legend=TRUE, bands=c(0.16, 0.84), grid=TRUE, bw=FALSE, maxit=1000)

Arguments

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 irfdraws. The default value is 4.
constant
A logical statement on whether to include an intercept in the model. This should correspond to the value used to generate irfdraws. The default is 'TRUE'.
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 irfdraws. The default is "median".
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 type, in the graph. If type correponds to the value used to generate irfdraws, this will be identical to the impulse responses of the model irfdraws is evaluating. The default is 'TRUE'.
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.

Value

The function returns a plot of the median target responses with user-selected percentiles.

Details

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.

References

Fry, R. and Pagan, A. (2011), "Sign restrictions in structural vector autoregressions: A critical review", Journal of Economic Literature, 49, 938-960.

See Also

rfbvar, uhlig.reject, uhlig.penalty, rwz.reject, irfplot, fevdplot.

Examples

Run this code
## 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)
 

Run the code above in your browser using DataLab