weights

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

Compute the importance sampling weights for a given observation y. If y_train is given it will be used as the database observations for which to compute the weights. Thie can be used to reduce the lookup scope in order to improve computational performance.

The weight \(w_i\) for database entry \(i\) and given observation \(y\) is computed as:

\[w_i = \exp \{ -\frac{1}{2} (\mathbf{y} - \mathbf{y}_i)^T \mathbf{S}_o^{-1}(\mathbf{y} - \mathbf{y}_i) \}\]
Parameters
  • y (numpy.array) – The observations for which to compute the weights.

  • y_train (numpy.array) – 2D array containing the observations from the database for which to compute the weights. Channels are assumed to be along axis 1.

Returns

1D array

Array containing the importance sampling weights.

Return type

ws

Return