gibbs_mlr()
is used to fit a Bayesian linear regression model using
Gibbs sampling.
gibbs_mlr(
formula,
data,
m = 100,
burn = 0,
thin = 1,
mu0 = NULL,
sigma0 = NULL,
a0 = NULL,
b0 = NULL,
eta_start = NULL,
verbose = FALSE,
display_progress = FALSE
)
An object of class formula
: a symbolic
description of the model to be fitted.
An optional data frame containing the variables in the model.
The number of iterations to run the Gibbs sampler (default: 100
).
The number of iterations to discard as the burn-in
period (default: 0
).
The period of iterations to keep after the burn-in
period (default: 1
).
An optional p x 1 mean vector for the prior on the regression coefficients. See 'Details'.
A p x p variance-covariance matrix for the prior on the regression coefficients. See 'Details'.
The shape parameter for the prior on sigma2 (default: 0.001
).
The scale parameter for the prior on sigma2 (default: 0.001
).
A p x 1 vector of starting values for the regression coefficients.
Should parameter draws be output during sampling? (default:
FALSE
).
Show progress bar? (default: FALSE
). Do not use
with verbose = TRUE
.
For mu0
, by default, we use a vector of \(p\) 0s for \(p\)
regression coefficients.
For sigma0
, by default, we use a \(p\) x \(p\) identity matrix.
Other Gibbs sampler:
gibbs_logistic()
,
gibbs_sldax()
# NOT RUN {
data(mtcars)
m1 <- gibbs_mlr(mpg ~ hp, data = mtcars)
# }
Run the code above in your browser using DataLab