Skip to contents

Fit a linear regression model using mean-field variational Bayes approximation.

Usage

mfvb_lm(
  formula,
  data,
  subset,
  weights,
  na.action,
  prior = NULL,
  contrasts = NULL,
  x = FALSE,
  y = FALSE,
  ...
)

Arguments

formula

an object of class [stats::formula].

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which lm is called.

subset

subset of data

weights

weighting

na.action

handling of na

prior

a list with elements (mu0, Sigma0, a, b) giving the model prior parameters.

contrasts

design contrasts

x

return design matrix

y

return response vector

...

further arguments to `vb_lm`

Value

An `mfvb` object