predict_quantiles

BMCI.predict_quantiles(y_obs, quantiles, x2_max=-1)[source]

This estimates the quantiles given in quantiles by approximating the CDF of the posterior as

\[F(x | \mathbf{y}) = \int_{-\infty}^{x} p(x' | \mathbf{y}) \: dx' \approx \sum_{x_i < x} \frac{w_i(\mathbf{y})}{\sum_j w_j(\mathbf{y})}\]

and then interpolating \(F^{-1}\) to obtain the desired quantiles.

Parameters:
  • y_obs (numpy.array) – n-times-m matrix containing the n observations with m channels for which to compute the percentiles.

  • quantiles (numpy.array) – 1D array containing the k quantiles \(\tau \in [0,1]\) to compute.

  • x2_max (float) – The \(\chi^2\) cutoff to apply to elements in the database. Ignored if less than zero.

Returns:

A 2D numpy.array with shape (n, k) array containing the estimated quantiles or NAN if no database entries were found in the \(\chi^2\) search region.

Raises:
  • ValueError – If the number of channels in the observations is different from the database.

  • ValueError – If any of the percentiles lies outside the interval [0, 1].