This documentation is for astroML version 0.2

This page


astroML Mailing List

GitHub Issue Tracker


Scipy 2012 (15 minute talk)

Scipy 2013 (20 minute talk)


If you use the software, please consider citing astroML. astroML.linear_model.TLS_logL

astroML.linear_model.TLS_logL(v, X, dX)

Compute the total least squares log-likelihood

This uses Hogg et al eq. 29-32

Parameters :

v : ndarray

The normal vector to the linear best fit. shape=(D,). Note that the magnitude |v| is a stand-in for the intercept.

X : ndarray

The input data. shape = [N, D]

dX : ndarray

The covariance of the errors for each point. For diagonal errors, the shape = (N, D) and the entries are dX[i] = [sigma_x1, sigma_x2 ... sigma_xD] For full covariance, the shape = (N, D, D) and the entries are dX[i] = Cov(X[i], X[i]), the full error covariance.

Returns :

logL : float

The log-likelihood of the model v given the data.


This implementation follows Hogg 2010, arXiv 1008.4686