add_priors.bvecmodel {bvartools} | R Documentation |
Add Priors for Vector Error Correction Models
Description
Adds prior specifications to a list of models, which was produced by
function gen_vec
.
Usage
## S3 method for class 'bvecmodel'
add_priors(
object,
coef = list(v_i = 1, v_i_det = 0.1, shape = 3, rate = 1e-04, rate_det = 0.01),
coint = list(v_i = 0, p_tau_i = 1, shape = 3, rate = 1e-04, rho = 0.999),
sigma = list(df = "k", scale = 1, mu = 0, v_i = 0.01, sigma_h = 0.05, constant = 1e-04),
ssvs = NULL,
bvs = NULL,
...
)
Arguments
object |
a list, usually, the output of a call to |
coef |
a named list of prior specifications for coefficients that do not
determine the cointegration space. For the default specification all prior means are set to zero
and the diagonal elements of the inverse prior variance-covariance matrix are set to 1
for coefficients corresponding to non-deterministic terms. For deterministic coefficients the prior
variances are set to 10 by |
coint |
a named list of prior specifications for coefficients determining the cointegration space of VEC models. See 'Details'. |
sigma |
a named list of prior specifications for the error variance-covariance matrix of the models. For the default specification of an inverse Wishart distribution the prior degrees of freedom are set to the number of endogenous variables plus the rank of the cointegration matrix. The prior variance is to 1. See 'Details'. |
ssvs |
optional; a named list of prior specifications for the SSVS algorithm. Not allowed for TVP models. See 'Details'. |
bvs |
optional; a named list of prior specifications for the BVS algorithm. See 'Details'. |
... |
further arguments passed to or from other methods. |
Details
The arguments of the function require named lists. Possible specifications are described in the following. Note that it is important to specify the priors in the correct list. Otherwise, the provided specification will be disregarded and default values will be used.
Argument coef
contains the following elements
v_i
a numeric specifying the prior precision of the coefficients. Default is 1.
v_i_det
a numeric specifying the prior precision of coefficients that correspond to deterministic terms. Default is 0.1.
const
a character specifying the prior mean of coefficients, which correspond to the intercept. If
const = "mean"
, the means of the series of endogenous variables are used as prior means. Ifconst = "first"
, the first values of the series of endogenous variables are used as prior means.minnesota
a list of length 4 containing parameters for the calculation of the Minnesota prior, where the element names must be
kappa0
,kappa1
,kappa2
andkappa3
. For the endogenous variablei
the prior variance of thel
th lag of regressorj
is obtained as\frac{\kappa_{0}}{l^2} \textrm{ for own lags of endogenous variables,}
\frac{\kappa_{0} \kappa_{1}}{l^2} \frac{\sigma_{i}^2}{\sigma_{j}^2} \textrm{ for endogenous variables other than own lags,}
\frac{\kappa_{0} \kappa_{2}}{(l+1)^2} \frac{\sigma_{i}^2}{\sigma_{j}^2} \textrm{ for exogenous variables,}
\kappa_{0} \kappa_{3} \sigma_{i}^2 \textrm{ for deterministic terms,}
where
\sigma_{i}
is the residual standard deviation of variablei
of an unrestricted LS estimate. For exogenous variables\sigma_{i}
is the sample standard deviation.The function only provides priors for the non-cointegration part of the model. However, the residual standard errors
\sigma_i
are based on an unrestricted LS regression of the endogenous variables on the error correction term and the non-cointegration regressors.max_var
a numeric specifying the maximum prior variance that is allowed for non-deterministic coefficients.
shape
a numeric specifying the prior shape parameter of the error term of the state equation. Only used for models with time varying parameters. Default is 3.
rate
a numeric specifying the prior rate parameter of the error term of the state equation. Only used for models with time varying parameters. Default is 0.0001.
rate_det
a numeric specifying the prior rate parameter of the error term of the state equation for coefficients, which correspond to deterministic terms. Only used for models with time varying parameters. Default is 0.01.
If minnesota
is specified, elements v_i
and v_i_det
are ignored.
Argument coint
can contain the following elements:
v_i
numeric between 0 and 1 specifying the shrinkage of the cointegration space prior. Default is 0.
p_tau_i
numeric of the diagonal elements of the inverse prior matrix of the central location of the cointegration space
sp(\beta)
. Default is 1.shape
an integer specifying the prior degrees of freedom of the error term of the state equation of the loading matrix
\alpha
. Default is 3.rate
a numeric specifying the prior variance of error term of the state equation of the loading matrix
\alpha
. Default is 0.0001.rho
a numeric specifying the autocorrelation coefficient of the state equation of
\beta
. It must be smaller than 1. Default is 0.999. Note that in contrast to Koop et al. (2011)\rho
is not drawn in the Gibbs sampler of this package yet.
Argument sigma
can contain the following elements:
df
an integer or character specifying the prior degrees of freedom of the error term. Only used, if the prior is inverse Wishart. Default is
"k"
, which indicates the amount of endogenous variables in the respective model."k + 3"
can be used to set the prior to the amount of endogenous variables plus 3. If an integer is provided, the degrees of freedom are set to this value in all models. In all cases the rankr
of the cointegration matrix is automatically added.scale
a numeric specifying the prior error variance of endogenous variables. Default is 1.
shape
a numeric or character specifying the prior shape parameter of the error term. Only used, if the prior is inverse gamma or if time varying volatilities are estimated. For models with constant volatility the default is
"k"
, which indicates the amount of endogenous variables in the respective country model."k + 3"
can be used to set the prior to the amount of endogenous variables plus 3. If a numeric is provided, the shape parameters are set to this value in all models. For models with stochastic volatility this prior refers to the error variance of the state equation.rate
a numeric specifying the prior rate parameter of the error term. Only used, if the prior is inverse gamma or if time varying volatilities are estimated. For models with stochastic volatility this prior refers to the error variance of the state equation.
mu
numeric of the prior mean of the initial state of the log-volatilities. Only used for models with time varying volatility.
v_i
numeric of the prior precision of the initial state of the log-volatilities. Only used for models with time varying volatility.
sigma_h
numeric of the initial draw for the variance of the log-volatilities. Only used for models with time varying volatility.
constant
numeric of the constant, which is added before taking the log of the squared errors. Only used for models with time varying volatility.
covar
logical indicating whether error covariances should be estimated. Only used in combination with an inverse gamma prior or stochastic volatility, for which
shape
andrate
must be specified.
df
and scale
must be specified for an inverse Wishart prior. shape
and rate
are required for an inverse gamma prior. For structural models or models with stochastic volatility
only a gamma prior specification is allowed.
Argument ssvs
can contain the following elements:
inprior
a numeric between 0 and 1 specifying the prior probability of a variable to be included in the model.
tau
a numeric vector of two elements containing the prior standard errors of restricted variables (
\tau_0
) as its first element and unrestricted variables (\tau_1
) as its second.semiautomatic
an numeric vector of two elements containing the factors by which the standard errors associated with an unconstrained least squares estimate of the model are multiplied to obtain the prior standard errors of restricted (
\tau_0
) and unrestricted (\tau_1
) variables, respectively. This is the semiautomatic approach described in George et al. (2008).covar
logical indicating if SSVS should also be applied to the error covariance matrix as in George et al. (2008).
exclude_det
logical indicating if deterministic terms should be excluded from the SSVS algorithm.
minnesota
a numeric vector of length 4 containing parameters for the calculation of the Minnesota-like inclusion priors. See below.
Either tau
or semiautomatic
must be specified.
The argument bvs
can contain the following elements
inprior
a numeric between 0 and 1 specifying the prior probability of a variable to be included in the model.
covar
logical indicating if BVS should also be applied to the error covariance matrix.
exclude_det
logical indicating if deterministic terms should be excluded from the BVS algorithm.
minnesota
a numeric vector of length 4 containing parameters for the calculation of the Minnesota-like inclusion priors. See below.
If either ssvs$minnesota
or bvs$minnesota
is specified, prior inclusion probabilities
are calculated in a Minnesota-like fashion as
\frac{\kappa_1}{l} | for own lags of endogenous variables, |
\frac{\kappa_2}{l} | for other endogenous variables, |
\frac{\kappa_3}{1 + l} | for exogenous variables, |
\kappa_{4} | for deterministic variables, |
for lag l
with \kappa_1
, \kappa_2
, \kappa_3
, \kappa_4
as the first, second,
third and forth element in ssvs$minnesota
or bvs$minnesota
, respectively.
Value
A list of models.
References
Chan, J., Koop, G., Poirier, D. J., & Tobias J. L. (2019). Bayesian econometric methods (2nd ed.). Cambridge: Cambridge University Press.
George, E. I., Sun, D., & Ni, S. (2008). Bayesian stochastic search for VAR model restrictions. Journal of Econometrics, 142(1), 553–580. doi:10.1016/j.jeconom.2007.08.017
Koop, G., León-González, R., & Strachan R. W. (2010). Efficient posterior simulation for cointegrated models with priors on the cointegration space. Econometric Reviews, 29(2), 224–242. doi:10.1080/07474930903382208
Koop, G., León-González, R., & Strachan R. W. (2011). Bayesian inference in a time varying cointegration model. Journal of Econometrics, 165(2), 210–220. doi:10.1016/j.jeconom.2011.07.007
Korobilis, D. (2013). VAR forecasting using Bayesian variable selection. Journal of Applied Econometrics, 28(2), 204–230. doi:10.1002/jae.1271
Lütkepohl, H. (2006). New introduction to multiple time series analysis (2nd ed.). Berlin: Springer.
Examples
# Get data
data("e6")
# Create model
model <- gen_vec(e6, p = 4, r = 1,
const = "unrestricted", seasonal = "unrestricted",
iterations = 100, burnin = 10)
# Chosen number of iterations and burnin should be much higher.
# Add priors
model <- add_priors(model)