msfit-class {mombf} | R Documentation |
Class "msfit"
Description
Stores the output of Bayesian variable selection, as produced by
function modelSelection
.
The class extends a list, so all usual methods for lists also work for
msfit
objects, e.g. accessing elements, retrieving names etc.
Methods are provided to compute posterior probabilities, obtaining regression coefficient estimates and posterior intervals (both via Bayesian model averaging and for individual models), and sampling from their posterior distribution, as indicated below.
Objects from the Class
Typically objects are automatically created by a call to modelSelection
.
Alternatively, objects can be created by calls of the form
new("msfit",x)
where x
is a list with the adequate
elements (see slots).
Slots
The class extends a list with elements:
- postSample
matrix
with posterior samples for the model indicator.postSample[i,j]==1
indicates that variable j was included in the model in the MCMC iteration i- postOther
postOther
returns posterior samples for parameters other than the model indicator, i.e. basically hyper-parameters. If hyper-parameters were fixed in the model specification,postOther
will be empty.- margpp
Marginal posterior probability for inclusion of each covariate. This is computed by averaging marginal post prob for inclusion in each Gibbs iteration, which is much more accurate than simply taking
colMeans(postSample)
.
- postMode
Model with highest posterior probability amongst all those visited
- postModeProb
Unnormalized posterior prob of posterior mode (log scale)
- postProb
Unnormalized posterior prob of each visited model (log scale)
- family
Residual distribution, i.e. argument
family
when callingmodelSelection
- p
Number of variables
- priors
Priors specified when calling
modelSelection
- ystd
For internal use. Stores the response variable, standardized if
center
orscale
were set toTRUE
- xstd
For internal use. Stores the covariates, standardized if
center
orscale
were set toTRUE
- stdconstants
For internal use. If
center
orscale
were set toTRUE
, stores the sample mean and standard deviation of the outcome and covariates- call
Stores info about the call, the formula used (if any), splines used etc
Methods
- coef
Obtains posterior means and intervals via Bayesian model averaging
- coefByModel
Obtains posterior means and intervals for individual models
- plot
Shows estimated posterior inclusion probability for each parameter vs. number of MCMC iterations
- predict
Obtains posterior means and intervals for given covariate values. These are posterior intervals for the mean, not posterior predictive intervals for the outcome
- show
signature(object = "msfit")
: Displays general information about the object.- postProb
signature(object = "msfit")
: Extracts posterior model probabilities.- rnlp
signature(object = "msfit")
: Obtain posterior samples for regression coefficients.
Author(s)
David Rossell
References
Johnson VE, Rossell D. Non-Local Prior Densities for Default Bayesian Hypothesis Tests. Journal of the Royal Statistical Society B, 2010, 72, 143-170
Johnson VE, Rossell D. Bayesian model selection in high-dimensional settings. Journal of the American Statistical Association, 107, 498:649-660.
See Also
See also modelSelection
and rnlp
.
Examples
showClass("msfit")