View source: R/add_priors.gvecsubmodels.R
add_priors.gvecsubmodels | R Documentation |
Adds prior specifications to a list of country models, which was produced by
the function create_models
.
## S3 method for class 'gvecsubmodels'
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),
ssvs = NULL,
bvs = NULL
)
object |
a named list, usually, the output of a call to |
... |
further arguments passed to or from other methods. |
coef |
a named list of prior specifications for the coefficients of the country-specific
models. 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 via |
coint |
a named list of prior specifications for cointegration coefficients of country-specific VEC models. See 'Details'. |
sigma |
a named list of prior specifications for the error variance-covariance matrix of the country models. For the default specification of an inverse Wishart distribution the prior degrees of freedom are set to the number of endogenous variables and the prior variances to 1. See 'Details'. |
ssvs |
a named list of prior specifications for the SSVS algorithm. See 'Details'. |
bvs |
a named list of prior specifications for the BVS algorithm. See 'Details'. |
The argument coef
can contain 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 corresponding to deterministic terms. Default is 0.1.
coint_var
a logical specifying whether the prior mean of the first own lag of an
endogenous variable in a VAR model should be set to 1. Default is FALSE
.
const
a numeric or character specifying the prior mean of coefficients, which correspond
to the intercept. If a numeric is provided, all prior means are set to this value.
If const = "mean"
, the means of the series of endogenous variables are used as prior means.
If const = "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 are kappa0
, kappa1
, kappa2
and kappa3
.
For the endogenous variable i
the prior variance of the l
th
lag of regressor j
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}}{(1 + l)^2} \frac{\sigma_{i}^2}{\sigma_{j}^2} \textrm{ for foreign and global exogenous variables,}
\kappa_{0} \kappa_{3} \sigma_{i}^2 \textrm{ for deterministic terms,}
where \sigma_{i}
is the residual standard deviation of variable i
of an unrestricted
LS estimate. For exogenous variables \sigma_{i}
is the sample standard deviation.
If kappa2 = NULL
, \kappa_{0} \kappa_{3} \sigma_{i}^2
will be used for foreign
and global exogenous variables instead.
For VEC models the function only provides priors for the non-cointegration part of the model. 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
an integer specifying the prior degrees of freedom of the error term of the state equation. Default is 3.
rate
a numeric specifying the prior error variance of the state equation. Default is 0.0001.
rate_det
a numeric specifying the prior error variance of the state equation corresponding to deterministic terms. Default is 0.0001.
If minnesota
is specified, v_i
and v_i_det
are ignored.
The argument coint
can contain the following elements
coint_v_i
numeric between 0 and 1 specifying the shrinkage of the cointegration space prior. Default is 0.
coint_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.
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 rank r
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
and
rate
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.
A list of country models.
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. \Sexpr[results=rd]{tools:::Rd_expr_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. \Sexpr[results=rd]{tools:::Rd_expr_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. \Sexpr[results=rd]{tools:::Rd_expr_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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/jae.1271")}
Lütkepohl, H. (2006). New introduction to multiple time series analysis (2nd ed.). Berlin: Springer.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.