uhlig.penalty: Uhlig's (2005) penalty function method

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/uhlig.penalty.R

Description

Identifies stuctural shocks using Uhlig's (2005) penalty function method and estimates a Bayesian vector autoregression model with a flat Normal inverted-Wishart prior.

Usage

1
2
uhlig.penalty(Y=NULL, nlags=4, draws=1000, subdraws=1000, nkeep=1000, KMIN=1, KMAX=4,
            constrained=NULL, constant=TRUE, steps=24, penalty=100, crit=0.001)

Arguments

Y

A ts object containing the data series used for estimation; this should be of size T x nvar.

nlags

The number of lags to include of each variable. The default value is 4.

draws

An integer value for the number of Markov Chain Monte Carlo (MCMC) sampling replications. The default value is 1000.

subdraws

An integer value for the number of iterations of the penalty function minimisation routine. The default value is 1000.

nkeep

An integer value for the number of desired MCMC draws that meet the imposed sign restrictions. The default value is 1000.

KMIN

An integer value for the first period of the impulse responses to which the sign restrictions apply. The default value is 1.

KMAX

An integer value for the last period of the impulse responses to which the sign restrictions apply. The default value is 4.

constrained

A list of sign restrictions of length <= nvar. The first entry of the list characterises the shock of interest. You MUST specify a sign restriction for the shock of interest.

constant

A logical statement on whether to include an intercept in the model. The default is 'TRUE'.

steps

An integer value for the horizon of the impulse response calculations. The default value is 24.

penalty

A value >= 0 for the penalty applied to the responses that do not satisfy the imposed sign restrictions. The default is 100.

crit

A value for the critical difference between two penalty function minimisation runs for which a draw gets rejected. The default is 0.001

Details

This function estimates a BVAR model using a flat Normal inverted-Wishart prior. Structural shocks are identified using Uhlig's (2005) penalty function method. The size of the shock is one standard deviation. uhlig.penalty is a partial identification method. Only one shock of interest is identified at a time by the sign restrictions provided. The MCMC routine stops when either enough draws have been found that satisfy the sign restrictions (specified in nkeep) or the maximum number of draws has been reached.

Sign restrictions are specified as follows: The first entry of constrained is the shock of interest corresponding to the column of the variable in Y. You MUST specify a sign restriction for the shock of interest on itself. Restrictions of the shock of interest on other variables are optional. The sign of the entry in the list corresponds to the direction of the sign, e.g. >0 or <0. Variables that are not listed in constrained remain unconstrained. In the example below, the shock of interest is the 4th variable (FED funds rate) in Y. The sign indicates that the effect on itself is contrained to be positive. The responses of the 2nd, 3rd, and 5th variable in the model to a positive FED funds rate shock is restricted to be negative. The responses of the 1st and 6th variable are unconstrained.

Value

A list of the posterior draws, which contains:

IRFS

A draws x steps x nvar array of posterior impulse responses.

FEVDS

A draws x steps x nvar array of posterior forecast error variance decompositions.

SHOCKS

A draws x (T-nlags) array of posterior draws of the model's shocks.

Bdraws

A draws x nvar array of posterior draws of the model coefficients.

Sdraws

A draws x nvar x nvar array of posterior draws of the model's variance-covariance matrix.

Note

Users should consult the reference papers and the package vignette for more information.

Author(s)

Christian Danne

References

Uhlig, H. (2005), "What Are the Effects of Monetary Policy on Output? Results from an Agnostic Identification Procedure", Journal of Monetary Economics, 52, 381-419.

See Also

rfbvar, uhlig.reject, rwz.reject, fp.target, irfplot, fevdplot.

Examples

 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
32
33
## Not run: 
# Replication of Figure 14 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
# shock of interest enters first.
# you MUST provide a restriction for the shock of interest
# restriction variable 4 is >0
# 2nd, 3rd, and 5th variable are <0.
# 1st and 6th variable are unrestricted
constr <- c(+4,-3,-2,-5)

# estimates the model
model2 <- uhlig.penalty(Y=uhligdata, nlags=12, draws=2000, subdraws=1000,
                        nkeep=1000, KMIN=1, KMAX=6, constrained=constr,
                        constant=FALSE, steps=60, penalty=100, crit=0.001)

# get posterior draws
irfs2 <- model2$IRFS

# plot impulse response functions
irfplot(irfdraws=irfs2, type="mean", labels=vl, save=FALSE, bands=c(0.16, 0.84),
        grid=TRUE, bw=FALSE)


## End(Not run)
 

VARsignR documentation built on May 2, 2019, 5:20 a.m.