curepy.utilities.distributions module

curepy.utilities.distributions module#

Distribution functions

curepy.utilities.distributions.ln_multi_normal(theta: ndarray, mu: ndarray, Sa_inv: ndarray) float[source]#

Evaluate the log of an unnormalised multivariate normal prior.

Parameters:
  • theta – Current parameter vector to evaluate.

  • mu – Mean vector of the multivariate Gaussian.

  • Sa_inv – Inverse of the prior covariance matrix.

Returns:

Log probability proportional to the multivariate Gaussian log-density.

curepy.utilities.distributions.ln_normal(theta: float | ndarray, mu: float | ndarray, sigma: float | ndarray) float | ndarray[source]#

Evaluate the log of an unnormalised normal (Gaussian) prior distribution.

Parameters:
  • theta – Current parameter value(s) to evaluate.

  • mu – Mean of the Gaussian distribution.

  • sigma – Standard deviation of the Gaussian distribution.

Returns:

Log probability proportional to the Gaussian log-density.

curepy.utilities.distributions.ln_trunc_normal(theta: float | ndarray, mu: float | ndarray, sigma: float | ndarray, minimum: float | ndarray, maximum: float | ndarray) float | ndarray[source]#

Evaluate the log of a truncated normal prior distribution.

Parameters:
  • theta – Current parameter value(s) to evaluate.

  • mu – Mean of the normal distribution.

  • sigma – Standard deviation of the normal distribution.

  • minimum – Lower bound of the truncation.

  • maximum – Upper bound of the truncation.

Returns:

Log probability proportional to the truncated normal log-density.

curepy.utilities.distributions.ln_uniform(theta: float | ndarray, minimum: float | ndarray, maximum: float | ndarray) float[source]#

Evaluate the log of a uniform prior distribution.

Returns 0 when all elements of theta are strictly within [minimum, maximum], and -inf otherwise.

Parameters:
  • theta – Current parameter value(s) to evaluate.

  • minimum – Lower bound(s) of the uniform distribution.

  • maximum – Upper bound(s) of the uniform distribution.

Returns:

Log probability: 0 if in-bounds, -numpy.inf otherwise.