.fit.bayes {tidyfit}R Documentation

Bayesian generalized linear regression for tidyfit

Description

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

Usage

## S3 method for class 'bayes'
.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 arm::bayesglm. See ?bayesglm for more details.

Implementation

No implementation notes

Value

A fitted 'tidyFit' class model.

A 'tibble'.

Author(s)

Johann Pfitzinger

References

Gelman A, Su Y (2021). arm: Data Analysis Using Regression and Multilevel/Hierarchical Models. R package version 1.12-2, https://CRAN.R-project.org/package=arm.

See Also

.fit.glm and m methods

Examples

# Load data
data <- tidyfit::Factor_Industry_Returns

# Stand-alone function
fit <- m("bayes", Return ~ ., data)
fit

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



[Package tidyfit version 0.7.1 Index]