A Gibbs Sampler for Multivariate Linear Regression

Adam B. Mantz
9/3/2015
astro-ph.IMastro-ph.COstat.ME

Official code: abmantz/lrgs (20 stars, MIT, last commit 2022-03-15).

Abstract

Kelly (2007, hereafter K07) described an efficient algorithm, using Gibbs sampling, for performing linear regression in the fairly general case where non-zero measurement errors exist for both the covariates and response variables, where these measurements may be correlated (for the same data point), where the response variable is affected by intrinsic scatter in addition to measurement error, and where the prior distribution of covariates is modeled by a flexible mixture of Gaussians rather than assumed to be uniform. Here I extend the K07 algorithm in two ways. First, the procedure is generalized to the case of multiple response variables. Second, I describe how to model the prior distribution of covariates using a Dirichlet process, which can be thought of as a Gaussian mixture where the number of mixture components is learned from the data. I present an example of multivariate regression using the extended algorithm, namely fitting scaling relations of the gas mass, temperature, and luminosity of dynamically relaxed galaxy clusters as a function of their mass and redshift. An implementation of the Gibbs sampler in the R language, called LRGS, is provided.

View on arXivView PDF

Code Implementations(1)

abmantz/lrgsOfficial100%
MIT

Code to perform multivariate linear regression using Gibbs sampling

204Python, Jupyter NotebookApr 23, 20154 years agoMIT
gibbs-samplerlinear-regressionmultivariate-regression

Similar Papers

Cite this paper

@article{mantz2015gibbs,
  title  = {A Gibbs Sampler for Multivariate Linear Regression},
  author = {Adam B. Mantz},
  year   = {2015},
  eprint = {1509.00908},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1509.00908}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1509.00908.svg)](https://codeofpaper.com/paper/1509.00908)

Discussion