Learn R Programming

BMS (version 0.3.4)

BMS-package: Bayesian Model Sampling 0.3.4

Description

This package enables Bayesian Model Averaging over the classical normal-conjugate model with many prior options and posterior statistics.

Arguments

Details

Package:
BMS
Type:
Package
Version:
0.3.4
Date:
2015-11-13
License:
Artistic 2.0
The most important function is bms to perform bayesian model sampling for Bayesian model Averaging or Bayesian Model Selection. It basically offers to sample data according to different g-priors and model priors, and leaves the choice of different samplers (MCMC samplers, full or partial enumeration, and interaction samplers). The results provide analysis into models according to MCMC frequencies, and according to the posterior likelihood of the best nmodel models (cf. bms).

The functions coef.bma and summary.bma summarize the most important results.

The plotting functions plot.bma, image.bma, density.bma, pred.density, and gdensity are the most important plotting functions (inter alia). Most of them also produce numerical output.

Moreover there are other functions for posterior results, such as beta.draws.bma, pmp.bma, pmpmodel, post.var, post.pr2 and topmodels.bma, while c.bma helps to combine and parallelize sampling chains.

The function zlm estimates a Bayesian linear regression under Zellner's g prior, i.e. estimating a particular model without taking model uncertainty into account. The function as.zlm may be used for model selection.

Finally, the small-scale functions f21hyper, hex2bin and fullmodel.ssq provide addidtional utilities, as well as bma- and zlm-specific methods for variable.names, deviance, vcov, etc..

Consider the function topmod for more advanced programming tasks, as well as the possibility to customize coefficient priors (gprior-class) and model priors (mprior-class).

References

Feldkircher, M. and S. Zeugner (2009): Benchmark Priors Revisited: On Adaptive Shrinkage and the Supermodel Effect in Bayesian Model Averaging; IMF Working Paper 09-202

See Also

http://bms.zeugner.eu

Examples

Run this code
data(datafls)
mfls =bms(X.data=datafls,burn=1000,iter=9000,nmodel=100)
  info.bma(mfls)
  coef(mfls)
  coef(mfls,exact=TRUE,std.coefs=TRUE) 
  mfls[3]$topmod 
  image(mfls[1:20],FALSE) 
  plotModelsize(mfls,exact=TRUE) 
  density(mfls,"Spanish")
  

Run the code above in your browser using DataLab