.fit.bma | R Documentation |
tidyfit
Fits a Bayesian model averaging regression on a 'tidyFit' R6
class. The function can be used with regress
.
## S3 method for class 'bma'
.fit(self, data = NULL)
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). |
Hyperparameters:
None. Cross validation not applicable.
Important method arguments (passed to m
)
iter
(number of iteration draws)
mcmc
(model sampler used (default 'bd'))
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.
A fitted 'tidyFit' class model.
Johann Pfitzinger
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).
.fit.bayes
and m
methods
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.