View source: R/inclusion_prior.R
inclusion_prior | R Documentation |
Prior inclusion probabilities as required for stochastic search variable selection (SSVS) à la George et al. (2008) and Bayesian variable selection (BVS) à la Korobilis (2013).
inclusion_prior(
object,
prob = 0.5,
exclude_deterministics = TRUE,
minnesota_like = FALSE,
kappa = c(0.8, 0.5, 0.5, 0.8)
)
object |
an object of class |
prob |
a numeric specifying the prior inclusion probability of all model parameters. |
exclude_deterministics |
logical. If |
minnesota_like |
logical. If |
kappa |
a numeric vector of four elements containing the prior inclusion probabilities
of coefficients that correspond to own lags of endogenous variables, to endogenous variables,
which do not correspond to own lags, to exogenous variables and deterministic terms, respectively.
Only used if |
If minnesota_like = TRUE
, prior inclusion probabilities \underline{\pi}_1
are calculated as
\frac{\kappa_1}{r} | for own lags of endogenous variables, |
\frac{\kappa_2}{r} | for other endogenous variables, |
\frac{\kappa_3}{1 + r} | for exogenous variables, |
\kappa_{4} | for deterministic variables, |
for lag r
with \kappa_1
, \kappa_2
, \kappa_3
, \kappa_4
as the first, second,
third and forth element in kappa
, respectively.
For vector error correction models the function generates prior inclusion probabilities for differenced variables and unrestricted deterministc terms as described above. For variables in the error correction term prior inclusion probabilites are calculated as
\kappa_1 | fow own levels of endogenous variables, |
\kappa_2 | for levels of other endogenous variables, |
\kappa_3 | for levels of exogenous variables, |
\kappa_4 | for deterministic variables. |
A list containing a matrix of prior inclusion probabilities and an integer vector specifying the positions of variables, which should be included in the variable selction algorithm.
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")}
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")}
# Prepare data
data("e1")
# Generate model input
object <- gen_var(e1)
# Obtain inclusion prior
pi_prior <- inclusion_prior(object)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.