Skip to content

Commit

Permalink
Adds a little bit more documentation to likelihood
Browse files Browse the repository at this point in the history
  • Loading branch information
Francois committed Jul 26, 2020
1 parent f58da80 commit 95da132
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion jax_cosmo/likelihood.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,31 @@

def gaussian_log_likelihood(data, mu, C, constant_cov=True, inverse_method="inverse"):
"""
Computes the likelihood for some cl
Computes the log likelihood for a given data vector under a multivariate
Gaussian distribution.
If the covariance C is sparse (according to :meth:`jax_cosmo.sparse.is_sparse`)
use sparse inverse and determinant algorithms (and ignore ``inverse_method``).
Parameters
----------
data: array_like
Data vector, with shape [N].
mu: array_like, 1d
Mean of the Gaussian likelihood, with shape [N].
C: array_like or sparse matrix
Covariance of Gaussian likelihood with shape [N,N]
constant_cov: boolean
Whether to include the log determinant of the covariance matrix in the
likelihood. If `constant_cov` is true, the log determinant is ignored
(default: True)
inverse_method: string
Methods for computing the precision matrix. Either "inverse", "cholesky".
Note that this option is ignored when the covariance is sparse. (default: "inverse")
"""
# Computes residuals
r = mu - data
Expand Down

0 comments on commit 95da132

Please sign in to comment.