.fit.bma {tidyfit}R Documentation

Bayesian model averaging for tidyfit

Description

Fits a Bayesian model averaging regression on a 'tidyFit' R6 class. The function can be used with regress.

Usage

## S3 method for class 'bma'
.fit(self, data = NULL)

Arguments

self

a 'tidyFit' R6 class.

data

a data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).

Details

Hyperparameters:

None. Cross validation not applicable.

Important method arguments (passed to m)

The function provides a wrapper for BMS::bms. See ?bms for more details.

Implementation

The underlying function automatically generates plotting output, which is not suppressed.

Use coef(fit) to obtain posterior mean, standard deviation as well as posterior inclusion probabilities for the features.

Value

A fitted 'tidyFit' class model.

Author(s)

Johann Pfitzinger

References

Feldkircher, M. and S. Zeugner (2015). Bayesian Model Averaging Employing Fixed and Flexible Priors: The BMS Package for R, Journal of Statistical Software 68(4).

See Also

.fit.bayes and m methods

Examples

# Load data
data <- tidyfit::Factor_Industry_Returns

# Stand-alone function
fit <- m("bma", Return ~ `Mkt-RF` + HML + SMB + RMW + CMA, data)
fit

# Within 'regress' function
fit <- regress(data, Return ~ ., m("bma"), .mask = c("Date", "Industry"))
coef(fit)


[Package tidyfit version 0.7.1 Index]