ArticleslgStudy

mathematics

Bayesian multivariate linear regression

Bayesian multivariate linear regression is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Bayesian multivariate linear regression rather than just read about it. In short: In statistics, Bayesian multivariate linear regression is a Bayesian approach to multivariate linear regression, i.e. linear regression where the predicted outcome is a vector of correlated random variables rather than a single scalar random variable. A more general treatment of this approach can be found in the article MMSE estimator.

Key takeaways

  • Bayesian multivariate linear regression belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Bayesian multivariate linear regression to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Bayesian multivariate linear regression from memory before moving on to harder problems.

Reference excerpt

In statistics, Bayesian multivariate linear regression is a Bayesian approach to multivariate linear regression, i.e. linear regression where the predicted outcome is a vector of correlated random variables rather than a single scalar random variable. A more general treatment of this approach can be found in the article MMSE estimator.

Details Consider a regression problem where the dependent variable to be predicted is not a single real-valued scalar but an m-length vector of correlated real numbers. As in the standard regression setup, there are n observations, where each observation i consists of k−1 explanatory variables, grouped into a vector 𝐱i of length k (where a dummy variable with a value of 1 has been added to allow for an intercept coefficient). This can be viewed as a set of m related regression problems for each observation i: yi,1=𝐱i𝖳𝜷1+ϵi,1⋮yi,m=𝐱i𝖳𝜷m+ϵi,m where the set of errors {ϵi,1,…,ϵi,m} are all correlated. Equivalently, it can be viewed as a single regression problem where the outcome is a row vector 𝐲i𝖳 and the regression coefficient vectors are stacked next to each other, as follows: 𝐲i𝖳=𝐱i𝖳𝐁+𝝐i𝖳. The coefficient matrix B is a k×m matrix where the coefficient vectors 𝜷1,…,𝜷m for each regression problem are stacked horizontally: 𝐁=[(𝜷1)⋯(𝜷m)]=[(β1,1⋮βk,1)⋯(β1,m⋮βk,m)]. The noise vector 𝝐i for each observation i is jointly normal, so that the outcomes for a given observation are correlated: 𝝐i∼N(0,𝜮ϵ). We can write the entire regression problem in matrix form as: 𝐘=𝐗𝐁+𝐄, where Y and E are n×m matrices. The design matrix X is an n×k matrix with the observations stacked vertically, as in the standard linear regression setup: 𝐗=[𝐱1𝖳𝐱2𝖳⋮𝐱n𝖳]=[x1,1⋯x1,kx2,1⋯x2,k⋮⋱⋮xn,1⋯xn,k]. The classical, frequentists linear least squares solution is to simply estimate the matrix of regression coefficients 𝐁̂ using the Moore-Penrose pseudoinverse: 𝐁̂=(𝐗𝖳𝐗)−1𝐗𝖳𝐘. To obtain the Bayesian solution, we need to specify the conditional likelihood and then find the appropriate conjugate prior. As with the univariate case of linear Bayesian regression, we will find that we can specify a natural conditional conjugate prior (which is scale dependent). Let us write our conditional likelihood as ρ(𝐄|𝜮ϵ)∝|𝜮ϵ|−n/2exp⁡(−12tr⁡(𝐄𝖳𝜮ϵ−1𝐄)), writing the error 𝐄 in terms of 𝐘,𝐗, and 𝐁 yields ρ(𝐘|𝐗,𝐁,𝜮ϵ)∝|𝜮ϵ|−n/2exp⁡(−12tr⁡((𝐘−𝐗𝐁)𝖳𝜮ϵ−1(𝐘−𝐗𝐁))), We seek a natural conjugate prior—a joint density ρ(𝐁,Σϵ) which is of the same functional form as the likelihood. Since the likelihood is quadratic in 𝐁, we re-write the likelihood so it is normal in (𝐁−𝐁̂) (the deviation from classical sample estimate). Using the same technique as with Bayesian linear regression, we decompose the exponential term using a matrix-form of the sum-of-squares technique. Here, however, we will also need to use the Matrix Differential Calculus (Kronecker product and vectorization transformations). First, let us apply sum-of-squares to obtain new expression for the likelihood: ρ(𝐘|𝐗,𝐁,𝜮ϵ)∝|𝜮ϵ|−(n−k)/2exp⁡(−tr⁡(12𝐒𝖳𝐒𝜮ϵ−1))|𝜮ϵ|−k/2exp⁡(−12tr⁡((𝐁−𝐁̂)𝖳𝐗𝖳𝐗(𝐁−𝐁̂)𝜮ϵ−1)), 𝐒=𝐘−𝐗𝐁̂ We would like to develop a conditional form for the priors: ρ(𝐁,𝜮ϵ)=ρ(𝜮ϵ)ρ(𝐁|𝜮ϵ), where ρ(𝜮ϵ) is an inverse-Wishart distribution and ρ(𝐁|𝜮ϵ) is some form of normal distribution in the matrix 𝐁. This is accomplished using the vectorization transformation, which converts the likelihood from a function of the matrices 𝐁,𝐁̂ to a function of the vectors 𝜷=vec⁡(𝐁),𝜷̂=vec⁡(𝐁̂). Write tr⁡((𝐁−𝐁̂)𝖳𝐗𝖳𝐗(𝐁−𝐁̂)𝜮ϵ−1)=vec⁡(𝐁−𝐁̂)𝖳vec⁡(𝐗𝖳𝐗(𝐁−𝐁̂)𝜮ϵ−1) Let vec⁡(𝐗𝖳𝐗(𝐁−𝐁̂)𝜮ϵ−1)=(𝜮ϵ−1⊗𝐗𝖳𝐗)vec⁡(𝐁−𝐁̂), where 𝐀⊗𝐁 denotes the Kronecker product of matrices A and B, a generalization of the outer product which multiplies an m×n matrix by a p×q matrix to generate an mp×nq matrix, consisting of every combination of products of elements from the two matrices. Then vec⁡(𝐁−𝐁̂)𝖳(𝜮ϵ−1⊗𝐗𝖳𝐗)vec⁡(𝐁−𝐁̂)=(𝜷−𝜷̂)𝖳(𝜮ϵ−1⊗𝐗𝖳𝐗)(𝜷−𝜷̂) which will lead to a likelihood which is normal in (𝜷−𝜷̂). With the likelihood in a more tractable form, we can now find a natural (conditional) conjugate prior.

Conjugate prior distribution The natural conjugate prior using the vectorized variable 𝜷 is of the form: ρ(𝜷,𝜮ϵ)=ρ(𝜮ϵ)ρ(𝜷|𝜮ϵ), where ρ(𝜮ϵ)∼𝒲−1(𝐕0,𝝂0) and ρ(𝜷|𝜮ϵ)∼N(𝜷0,𝜮ϵ⊗𝜦0−1).

Posterior distribution Using the above prior and likelihood, the posterior distribution can be expressed as: ρ(𝜷,𝜮ϵ|𝐘,𝐗)∝|𝜮ϵ|−(𝝂0+m+1)/2exp⁡(−12tr⁡(𝐕0𝜮ϵ−1))×|𝜮ϵ|−k/2exp⁡(−12tr⁡((𝐁−𝐁0)𝖳𝜦0(𝐁−𝐁0)𝜮ϵ−1))×|𝜮ϵ|−n/2exp⁡(−12tr⁡((𝐘−𝐗𝐁)𝖳(𝐘−𝐗𝐁)𝜮ϵ−1)), where vec⁡(𝐁0)=𝜷0. The terms involving 𝐁 can be grouped (with 𝜦0=𝐔𝖳𝐔) using: (𝐁−𝐁0)𝖳𝜦0(𝐁−𝐁0)+(𝐘−𝐗𝐁)𝖳(𝐘−𝐗𝐁)=([𝐘𝐔𝐁0]−[𝐗𝐔]𝐁)𝖳([𝐘𝐔𝐁0]−[𝐗𝐔]𝐁)=([𝐘𝐔𝐁0]−[𝐗𝐔]𝐁n)𝖳([𝐘𝐔𝐁0]−[𝐗𝐔]𝐁n)+(𝐁−𝐁n)𝖳(𝐗𝖳𝐗+𝜦0)(𝐁−𝐁n)=(𝐘−𝐗𝐁n)𝖳(𝐘−𝐗𝐁n)+(𝐁0−𝐁n)𝖳𝜦0(𝐁0−𝐁n)+(𝐁−𝐁n)𝖳(𝐗𝖳𝐗+𝜦0)(𝐁−𝐁n), with 𝐁n=(𝐗𝖳𝐗+𝜦0)−1(𝐗𝖳𝐗𝐁̂+𝜦0𝐁0)=(𝐗𝖳𝐗+𝜦0)−1(𝐗𝖳𝐘+𝜦0𝐁0). This now allows us to write the posterior in a more useful form: ρ(𝜷,𝜮ϵ|𝐘,𝐗)∝|𝜮ϵ|−(𝝂0+m+n+1)/2exp⁡(−12tr⁡((𝐕0+(𝐘−𝐗𝐁𝐧)𝖳(𝐘−𝐗𝐁𝐧)+(𝐁n−𝐁0)𝖳𝜦0(𝐁n−𝐁0))𝜮ϵ−1))×|𝜮ϵ|−k/2exp⁡(−12tr⁡((𝐁−𝐁n)𝖳(𝐗T𝐗+𝜦0)(𝐁−𝐁n)𝜮ϵ−1)). This takes the form of an inverse-Wishart distribution times a Matrix normal distribution: ρ(𝜮ϵ|𝐘,𝐗)∼𝒲−1(𝐕n,𝝂n) and ρ(𝐁|𝐘,𝐗,𝜮ϵ)∼ℳ𝒩k,m(𝐁n,𝜦n−1,𝜮ϵ). The parameters of this posterior are given by: 𝐕n=𝐕0+(𝐘−𝐗𝐁𝐧)𝖳(𝐘−𝐗𝐁𝐧)+(𝐁n−𝐁0)𝖳𝜦0(𝐁n−𝐁0) 𝝂n=𝝂0+n 𝐁n=(𝐗𝖳𝐗+𝜦0)−1(𝐗𝖳𝐘+𝜦0𝐁0) 𝜦n=𝐗𝖳𝐗+𝜦0

See also Bayesian linear regression Matrix normal distribution

References

Box, G. E. P.; Tiao, G. C. (1973). "8". Bayesian Inference in Statistical Analysis. Wiley. ISBN 0-471-57428-7. Geisser, S. (1965). "Bayesian Estimation in Multivariate Analysis". The Annals of Mathematical Statistics. 36 (1): 150–159. doi:10.1214/aoms/1177700279. JSTOR 2238083. Tiao, G. C.; Zellner, A. (1964). "On the Bayesian Estimation of Multivariate Regression". Journal of the Royal Statistical Society. Series B (Methodological). 26 (2): 277–285. doi:10.1111/j.2517-6161.1964.tb00560.x. JSTOR 2984424.

Worked examples

Example 1 — a first encounter with Bayesian multivariate linear regression

Start with the simplest possible case. Write down what Bayesian multivariate linear regression claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Bayesian multivariate linear regression before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Bayesian multivariate linear regression ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Bayesian multivariate linear regression

In research
Bayesian multivariate linear regression appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Bayesian multivariate linear regression in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Bayesian multivariate linear regression is common in secondary-school and first-year university syllabi. It links to neighbouring topics Bayesian inference, Single-equation methods (econometrics), so understanding it makes those chapters shorter.
In everyday life
Look for Bayesian multivariate linear regression outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Bayesian multivariate linear regression” →

How to study Bayesian multivariate linear regression in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Bayesian multivariate linear regression means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Bayesian multivariate linear regression out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Bayesian multivariate linear regression in simple terms?

In statistics, Bayesian multivariate linear regression is a Bayesian approach to multivariate linear regression, i.e. linear regression where the predicted outcome is a vector of correlated random variables rather than a single scalar random variable. A more general treatment of this approach can b…

Why does Bayesian multivariate linear regression matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Bayesian multivariate linear regression?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Bayesian multivariate linear regression.

Tags

  • Bayesian inference
  • Single-equation methods (econometrics)

Keep exploring