Bayesian linear regression is a type of conditional modeling in which the mean of one variable is described by a linear combination of other variables, with the goal of obtaining the posterior probability of the regression coefficients (as well as other parameters describing the distribution of the regressand) and ultimately allowing the out-of-sample prediction of the regressand (often labelled y) conditional on observed values of the regressors (usually X). The simplest and most widely used version of this model is the normal linear model, in which y given X is distributed Gaussian. In this model, and under a particular choice of prior probabilities for the parameters—so-called conjugate priors—the posterior can be found analytically. With more arbitrarily chosen priors, the posteriors generally have to be approximated.
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 𝐱i: yi=𝐱i𝖳𝜷+ε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: ρ(𝐲∣𝐗,𝜷,σ2)∝(σ2)−n/2exp(−12σ2(𝐲−𝐗𝜷)𝖳(𝐲−𝐗𝜷)). The ordinary least squares solution is used to estimate the coefficient vector using the Moore–Penrose pseudoinverse: 𝜷̂=(𝐗𝖳𝐗)−1𝐗𝖳𝐲 where 𝐗 is the n×k design matrix, each row of which is a predictor vector 𝐱i𝖳; and 𝐲 is the column n-vector [y1⋯yn]𝖳. 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 𝐲 and 𝐗, the focus only on the distribution of 𝐲 conditional on 𝐗 needs justification. In fact, a "full" Bayesian analysis would require a joint likelihood ρ(𝐲,𝐗∣𝜷,σ2,γ) along with a prior ρ(β,σ2,γ), where γ symbolizes the parameters of the distribution for 𝐗. 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∣𝒙i) and γ indexing the marginal density of the regressors ρ(𝒙i) that data point yj not convey any additional information about data point yi beyond that contained in the regressors 𝒙i and the parameter vector 𝜷 Formally, the first condition requires that ρ(yi∣𝒙i,𝜽)=ρ(yi∣𝒙i,𝜷) and ρ(𝒙i∣𝜽)=ρ(𝒙i∣γ), and the second condition requires ρ(yi|yj,𝒙i,𝒙j,𝜷)=ρ(yi|𝒙i,𝜷) for all j≠i. Under strict exogeneity, the joint likelihood can then be factored into ρ(𝐲∣𝐗,β,σ2)ρ(𝐗∣γ). The latter part is usually ignored under the assumption of disjoint parameter sets. More strongly, 𝐗 is often considered as chosen (for example, in a designed experiment) and therefore has a known probability without parameters.
With conjugate priors
Conjugate prior distribution For an arbitrary prior distribution, there may be no analytical solution for the posterior distribution. In this section, we will consider a so-called conjugate prior for which the posterior distribution can be derived analytically. A prior ρ(𝜷,σ2) is conjugate to this likelihood function if the posterior has the same functional form with respect to 𝜷 and σ. Since the log-likelihood is quadratic in 𝜷, the log-likelihood is re-written such that the likelihood becomes normal in (𝜷−𝜷̂). Write (𝐲−𝐗𝜷)𝖳(𝐲−𝐗𝜷)=[(𝐲−𝐗𝜷̂)+(𝐗𝜷̂−𝐗𝜷)]𝖳[(𝐲−𝐗𝜷̂)+(𝐗𝜷̂−𝐗𝜷)]=(𝐲−𝐗𝜷̂)𝖳(𝐲−𝐗𝜷̂)+(𝜷−𝜷̂)𝖳(𝐗𝖳𝐗)(𝜷−𝜷̂)+2(𝐗𝜷̂−𝐗𝜷)𝖳(𝐲−𝐗𝜷̂)⏟= 0=(𝐲−𝐗𝜷̂)𝖳(𝐲−𝐗𝜷̂)+(𝜷−𝜷̂)𝖳(𝐗𝖳𝐗)(𝜷−𝜷̂). The likelihood is now re-written as ρ(𝐲|𝐗,𝜷,σ2)∝(σ2)−v2exp(−vs22σ2)(σ2)−n−v2exp(−12σ2(𝜷−𝜷̂)𝖳(𝐗𝖳𝐗)(𝜷−𝜷̂)), where vs2=(𝐲−𝐗𝜷̂)𝖳(𝐲−𝐗𝜷̂) and v=n−k, where k is the number of regression coefficients. This suggests a form for the prior: ρ(𝜷,σ2)=ρ(σ2)ρ(𝜷∣σ2), where ρ(σ2) is an inverse-gamma distribution ρ(σ2)∝(σ2)−v02−1exp(−v0s022σ2). In the notation introduced in the inverse-gamma distribution article, this is the density of an Inv-Gamma(a0,b0) distribution with a0=v02 and b0=12v0s02 with v0 and s02 as the prior values of v and s2, respectively. Equivalently, it can also be described as a scaled inverse chi-squared distribution, Scale-inv-χ2(v0,s02). Further the conditional prior density ρ(𝜷|σ2) is a normal distribution, ρ(𝜷∣σ2)∝(σ2)−k/2exp(−12σ2(𝜷−𝝁0)𝖳𝜦0(𝜷−𝝁0)). In the notation of the normal distribution, the conditional prior distribution is 𝒩(𝝁0,σ2𝜦0−1).
… excerpt ends here. Continue reading the full article.
