Learn R Programming

BMSC (version 0.2.1)

Bayesian Model Selection under Constraints

Description

A Bayesian regression package supporting constrained coefficient estimation and variable selection using Stan. This includes a robust variable selection algorithm by a horseshoe prior () that finds the optimal model considering main effects, interactions as well as powers of given variables under potential parameter constraints.

Copy Link

Version

Install

install.packages('BMSC')

Monthly Downloads

9

Version

0.2.1

License

GPL-3

Maintainer

Marcus Gross

Last Published

August 2nd, 2019

Functions in BMSC (0.2.1)

prepModelNames

Extract model names from model objects
tryAsFormula

Turn character vector into formula, return error if not possible
addInteractionToVars

Add interactions of a specific order to a vector of variables
ConstrainedLinReg-class

S4 class for constrained linear regression models
sortAndPaste

Sort a vector and collapse elements together using ":"
show,ConstrainedLinReg-method

Print constraint estimation model
makeInteractions

Add all interactions up to a desired order
prepPlotData

Prepare data to plot model fit
plotModelFit

Plot errors of all models
addPowToVars

Add exponent to a vector of variables
constrSelEst

Model selection algorithm for constrained estimation
makePoly

Create polynomial of degree maxExponent from variable names
plotModels

Plot model errors with errorbars
print.ConstrainedLinReg

Print constraint estimation model
createFormulaInternal

handleMissingData

Exclude rows with missing values
extractVarname

Extract variable name from polynomial expression
getBetaMatrix

getBestModel

Get Best Model after Models Selection
createFormula

Create a formula with interactions and polynomials up to a desired order
prepDatForPredict

Exclude rows with missing data on predictor variables
predict,ConstrainedLinReg-method

Compute predictions from constraint estimation model
prepColorVec

Prepare colour vector