Version of 0.3.0 of the Bayesian Model Averaging package BMS has been released. Apart from numerous bugfixes, BMS 0.3.0 includes two main additions:
- The ability in
bmsto keep certain fixed regressors to be included in all sampled models
- The option to calculate predictive densities with function
Moreover, the interrnal structure has been redesigned to accommodate user-defined priors and samplers.
Updating / Installing the new Version
If you are running R version 2.13 or above under Windows or any R version under Linux or Mac OS X, then simply type the R command:
If you are running an older R version under Windows, then use the following command, or refer to the manual installation page.
- Windows R version 2.10 to 2.12: type:
- Windows R version 2.5 to 2.9: type:
After installation, you may verify the version number by typing the following commands:
The corresponding help entry should then display the version number 0.3.0.
New Feature: Keeping Fixed Regressors
The new argument
fixed.reg in function
bms allows for keeping a fixed set of regressors to be included in all models. Take, for instance, the built-in
attitude data set. A researcher might be certain that any model for the dependent variable
rating should be based at least on the regressors
complaints. She just is not sure whether to add the remaining four regressors and wants to preform Bayesian Model Averaging over these four variables. The corresponding command is:
m1 = bms(attitude, mprior = "uniform", fixed.reg = c("complaints","learning"))
The resulting output then shows that the Posterior Inclusion Probabilities for
complaints are indeed at 100%. The resulting object
m1 is a standard
bma object and may be processed with any of the BMS functions.
For more details, consult chapter A.4 of the BMS tutorial.
New Feature: Predicitve Density
BMS now allows for creating predicitive densities that conform to the many available priors. For illustration, consider again the built-in dataset
attitude. We might use the first 27 observations to forecast the final 3 observations.
m2 = bms(attitude[1:27,]) pp = pred.density(m2, newdata=attitude[28:30, -1])
pp now holds the prediction for these 3 observations, conditional on what we know from the first 27 observations and the explanatory data. Several functions are available to extract meaningful information. For instance, the following command provides a plot of predictive densities for each data point:
User-defined Priors and Samplers
For more R-savy users, BMS now offers the possibility to write customized 'plug-in' priors: this applies to both the coefficient (g) priors and model priors. Similarly, the new version also implements limited customizability for MCMC samplers. For more details consider the tutorials on custom priors.
Other changes vs previous versions
The functionality of the BMS version 0.3.0 is compatible with earlier versions (0.2.5), therefore any previously user-written BMS code should continue to function.
Nonetheless, numerous bug-fixes to deal with exceptional situations have been implemented and required changes to many internal objects. For more details, consider the package technical News file.