View source: R/basic_complementary_functions.R
estimation.pep | R Documentation |
Simulates values from the (joint) posterior distribution of the beta coefficients under Bayesian model averaging.
estimation.pep(
object,
ssize = 10000,
estimator = "BMA",
n.models = NULL,
cumul.prob = 0.99
)
object |
An object of class pep (e.g., output of |
ssize |
Positive integer, the number of values to be simulated from the (joint) posterior distribution of the beta coefficients. Default value=10000. |
estimator |
A character, the type of estimation. One of
“BMA” (Bayesian model averaging, default),
“MAP” (maximum a posteriori model) or “MPM” (median probability model).
Default value= |
n.models |
Positive integer, the number of (top) models where
the average is based on or |
cumul.prob |
Numeric between zero and one, cumulative probability of
top models to be used for computing the average. Relevant for |
For the computations, Equation 10 of Garcia–Donato and Forte (2018) is used. That (simplified) formula arises when changing the prior on the model parameters to the reference prior. This change of prior is justified in Garcia–Donato and Forte (2018). The resulting formula is a mixture distribution and the simulation is implemented as follows: firstly the model (component) based on its posterior probability is chosen and subsequently the values of the beta coefficients included in the chosen model are drawn from the corresponding multivariate Student distribution, while the values of the beta coefficents outside the chosen model are set to zero.
Let k
be the number of models with cumulative posterior probability up
to the given value of cumul.prob
. Then, for Bayesian model averaging
the summation is based on the top (k+1)
models if they exist, otherwise
on the top k
models.
When both n.models
and cumul.prob
are provided — once
specifying the number of models for the given cumulative probability as
described above — the minimum between the two numbers is used for estimation.
estimation.pep
returns a matrix (of dimension
ssize
\times \, (p+1)
) —
where the rows correspond
to the simulations and the columns to the beta coefficients
(including the intercept) — containing the
simulated data.
Garcia–Donato, G. and Forte, A. (2018) Bayesian Testing, Variable Selection and Model Averaging in Linear Models using R with BayesVarSel. The R Journal, 10(1): 155–174. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.32614/RJ-2018-021")}
data(UScrime_data)
res <- pep.lm(y~.,data=UScrime_data)
set.seed(123)
estM1 <- estimation.pep(res,ssize=2000)
estM2 <- estimation.pep(res,ssize=2000,estimator="MPM")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.