BMAcoeff {BayesVarSel} | R Documentation |
Bayesian Model Averaged estimations of regression coefficients
Description
Samples of the model averaged objective posterior distribution of regression coefficients
Usage
BMAcoeff(x, n.sim = 10000, method = "svd")
Arguments
x |
An object of class |
n.sim |
Number of simulations to be produced |
method |
Text specifying the matrix decomposition used to determine the
matrix root of 'sigma' when simulating from the multivariate t distribution.
Possible methods are eigenvalue decomposition ('"eigen"', default), singular
value decomposition ('"svd"'), and Cholesky decomposition ('"chol"'). See
the help of command |
Details
The distribution that is sampled from is the discrete mixture of the (objective) posterior distributions of the regression coefficients with weights proportional to the posterior probabilities of each model. That is, from
latex
The models used in the mixture above are the retained best models (see the
argument n.keep
in Bvs) if x
was generated
with Bvs
and the sampled models with the associated frequencies if
x
was generated with GibbsBvs
. The formula for the objective
posterior distribution within each model latex
is
taken from Bernardo and Smith (1994) page 442.
Note: The above mixture is potentially highly multimodal and this command ends with a multiple plot with the densities of the different regression coefficients to show the user this peculiarity. Hence which summaries should be used to describe this distribution is a delicate issue and standard functions like the mean and variance are not recommendable.
Value
BMAcoeff
returns an object of class bma.coeffs
which
is a matrix with n.sim
rows with the simulations. Each column of the
matrix corresponds to a regression coefficient in the full model.
Author(s)
Gonzalo Garcia-Donato and Anabel Forte
Maintainer: <anabel.forte@uv.es>
See Also
See histBMA
for a histogram-like
representation of the columns in the object. See
Bvs
and
GibbsBvs
for creating objects of the class
Bvs
. See Mvnorm for details about argument
method.
Examples
## Not run:
#Analysis of Crime Data
#load data
data(UScrime)
crime.Bvs<- Bvs(formula= y ~ ., data=UScrime, n.keep=1000)
crime.Bvs.BMA<- BMAcoeff(crime.Bvs, n.sim=10000)
#the best 1000 models are used in the mixture
#We could force all possible models to be included in the mixture
crime.Bvs.all<- Bvs(formula= y ~ ., data=UScrime, n.keep=2^15)
crime.Bvs.BMA<- BMAcoeff(crime.Bvs.all, n.sim=10000)
#(much slower as this implies ordering many more models...)
#With the Gibbs algorithms:
data(Ozone35)
Oz35.GibbsBvs<- GibbsBvs(formula= y ~ ., data=Ozone35, prior.betas="gZellner",
prior.models="Constant", n.iter=10000, init.model="Full", n.burnin=100,
time.test = FALSE)
Oz35.GibbsBvs.BMA<- BMAcoeff(Oz35.GibbsBvs, n.sim=10000)
## End(Not run)