predict

BMCI.predict(y_obs, x2_max=-1.0)[source]

This performs the BMCI integration to approximate the mean and variance of the posterior distribution:

\[ \begin{align}\begin{aligned}\bar{x} = \int x p(x | \mathbf{y}) \: dx \approx \sum_i \frac{w_i(\mathbf{y}) x}{\sum_j w_j(\mathbf{y})}\\\text{var}(x) = \int (x - \bar{x})^2 p(x | \mathbf{y}) \: dx \approx \sum_i \frac{w_i(\mathbf{y}) x^2}{\sum_j w_j(\mathbf{y})}\end{aligned}\end{align} \]

By default this method computes weights for all entries in the database, which is slow for large databases. This can be avoided by setting the x2_max keyword to a non-negative value. This will be used to exclude weights that can be guaranteed to have a larger \(\Chi^2\) value than x2_max.

Parameters:
  • y_obs (numpy.ndarray) – Array of shape (n, m) containing the n observations for which to perform the retrieval.

  • x2_max (float) – If non-negative, database elements that can be guaranteed to have a higher chi-square value are excluded.

Returns:

A tuple (xs, sigmas) containing the retrieved means (xs) and the corresponding standard deviations (sigmas).