# BQBeliefUpdate¶

Bases: ABC

Abstract class for the inference scheme.

Parameters

jitter (FloatLike) – Non-negative jitter to numerically stabilise kernel matrix inversion.

Methods Summary

 __call__(bq_state, new_nodes, new_fun_evals, ...) Updates integral belief and BQ state according to the new data given. Compute the Cholesky decomposition of a positive-definite Gram matrix for use in scipy.linalg.cho_solve gram_cho_solve(gram_cho_factor, z) Wrapper for scipy.linalg.cho_solve. predict_integrand(x, bq_state) Predictive mean and variances of the integrand at given nodes.

Methods Documentation

abstract __call__(bq_state, new_nodes, new_fun_evals, *args, **kwargs)[source]

Updates integral belief and BQ state according to the new data given.

Parameters
• bq_state (BQState) – Current state of the Bayesian quadrature loop.

• new_nodes (ndarray) – shape=(n_eval_new, input_dim) – New nodes that have been added.

• new_fun_evals (ndarray) – shape=(n_eval_new,) – Function evaluations at the given node.

Returns

• updated_belief – Gaussian integral belief after conditioning on the new nodes and evaluations.

• updated_state – Updated version of bq_state that contains all updated quantities.

Return type
compute_gram_cho_factor(gram)[source]

Compute the Cholesky decomposition of a positive-definite Gram matrix for use in scipy.linalg.cho_solve

Warning

Uses scipy.linalg.cho_factor. The returned matrix is only to be used in scipy.linalg.cho_solve.

Parameters

gram (ndarray) – symmetric pos. def. kernel Gram matrix $$K$$, shape (nevals, nevals)

Returns

The upper triangular Cholesky decomposition of the Gram matrix. Other parts of the matrix contain random data. A boolean that indicates whether the matrix is lower triangular (always False but needed for scipy).

Return type

gram_cho_factor

static gram_cho_solve(gram_cho_factor, z)[source]

Wrapper for scipy.linalg.cho_solve. Meant to be used for linear systems of the gram matrix. Requires the solution of scipy.linalg.cho_factor as input.

Parameters
• gram_cho_factor (Tuple[ndarray, bool]) – The return object of compute_gram_cho_factor.

• z (ndarray) – An array of appropriate shape.

Returns

The solution x to the linear system gram x = z.

Return type

solution

abstract static predict_integrand(x, bq_state)[source]

Predictive mean and variances of the integrand at given nodes.

Parameters
• x (ndarray) – shape=(n_nodes, input_dim) – The nodes where to predict.

• bq_state (BQState) – The BQ state.

Returns

• mean_predictionshape=(n_nodes,) – The means of the predictions.

• var_predictionsshape=(n_nodes,) – The variances of the predictions.

Return type