semiconjugateblm
Bayesian linear regression model with semiconjugate prior for data likelihood
Description
The Bayesian linear regression
model object semiconjugateblm specifies that the
conditional prior distribution of
β|σ2 is
multivariate Gaussian with mean μ and variance V,
and the prior distribution of σ2 is
inverse gamma with shape A and scale B.
Specifically, the Bayesian linear regression model is the independent,
normal-inverse-gamma semiconjugate model.
The data likelihood is where ϕ(yt;xtβ,σ2) is the Gaussian probability density evaluated at yt with mean xtβ and variance σ2. The specified priors are semiconjugate for the likelihood, that is, the resulting conditional, but not marginal, posterior distributions are analytically tractable. For details on the posterior distribution, see Analytically Tractable Posteriors.
In general, when you create a Bayesian linear regression model object, it specifies the joint prior distribution and characteristics of the linear regression model only. That is, the model object is a template intended for further use. Specifically, to incorporate data into the model for posterior distribution analysis, pass the model object and data to the appropriate object function.
Creation
Syntax
Description
creates a Bayesian linear
regression model object (PriorMdl = semiconjugateblm(NumPredictors)PriorMdl) composed of
NumPredictors predictors and an intercept. The joint
prior distribution of (β,
σ2) is the independent
normal-inverse-gamma semiconjugate model. PriorMdl is a
template defining the prior distributions and dimensionality of
β.
uses additional options specified by one or more
PriorMdl = semiconjugateblm(NumPredictors,Name,Value)Name,Value pair arguments. Name is
a property name, except NumPredictors, and
Value is the corresponding value.
Name must appear inside single quotes
(''). You can specify several
Name,Value pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
Properties
Object Functions
estimate | Estimate posterior distribution of Bayesian linear regression model parameters |
simulate | Simulate regression coefficients and disturbance variance of Bayesian linear regression model |
forecast | Forecast responses of Bayesian linear regression model |
plot | Visualize prior and posterior densities of Bayesian linear regression model parameters |
summarize | Distribution summary statistics of standard Bayesian linear regression model |
Examples
More About
Algorithms
You can reset all model properties using dot notation, for example, PriorMdl.V
= diag(Inf(3,1)). For property resets, semiconjugateblm does
minimal error checking of values. Minimizing error checking has the
advantage of reducing overhead costs for Markov chain Monte Carlo
simulations, which results in efficient execution of the algorithm.
Alternatives
The bayeslm function can create any supported prior model object for Bayesian linear regression.
Version History
Introduced in R2017a