Lably
Skip to content

Bayesian linear regression

Method of statistical analysis

  • 5 min read
  • 3 chapters

Related on Lably

Through Linear combination, Probability distribution and Normal distribution

Model setup

Consider a standard linear regression problem, in which for i=1,…,n we specify the mean of the conditional distribution of yi given a k×1 predictor vector xi: yi=xiTβ+εi,

where β is a k×1 vector, and the εi are independent and identically normally distributed random variables: εi∼N(0,σ2).

This corresponds to the following likelihood function:

ρ(y∣X,β,σ2)∝(σ2)−n/2exp⁡(−12σ2(y−Xβ)T(y−Xβ)).

The ordinary least squares solution is used to estimate the coefficient vector using the Moore–Penrose pseudoinverse: β^=(XTX)−1XTy

where X is the n×k design matrix, each row of which is a predictor vector xiT; and y is the column n-vector [y1⋯yn]T.

This is a frequentist approach, and it assumes that there are enough measurements to say something meaningful about β. In the Bayesian approach, the data is supplemented with additional information in the form of a prior probability distribution. The prior belief about the parameters is combined with the data's likelihood function according to Bayes' theorem to yield the posterior belief about the parameters β and σ. The prior can take different functional forms depending on the domain and the information that is available a priori.

Since the data comprises both y and X, the focus only on the distribution of y conditional on X needs justification. In fact, a "full" Bayesian analysis would require a joint likelihood ρ(y,X∣β,σ2,γ) along with a prior ρ(β,σ2,γ), where γ symbolizes the parameters of the distribution for X.

We can factor out the joint likelihood by assuming strict exogeneity. Strict exogeneity requires:

  • that the parameter vector can θ=(β,γ) be decomposed into two components, with β indexing the conditional density of the response variable ρ(yi∣xi) and γ indexing the marginal density of the regressors ρ(xi)
  • that data point yj not convey any additional information about data point yi beyond that contained in the regressors xi and the parameter vector β

Formally, the first condition requires that ρ(yi∣xi,θ)=ρ(yi∣xi,β) and ρ(xi∣θ)=ρ(xi∣γ), and the second condition requires ρ(yi|yj,xi,xj,β)=ρ(yi|xi,β) for all j≠i.

Under strict exogeneity, the joint likelihood can then be factored into ρ(y∣X,β,σ2)ρ(X∣γ). The latter part is usually ignored under the assumption of disjoint parameter sets. More strongly, X is often considered as chosen (for example, in a designed experiment) and therefore has a known probability without parameters.

Sign in to keep reading

2 more chapters are free with a Lably account.

More in Statistics