bayesquad_from_data

probnum.quad.bayesquad_from_data(nodes, fun_evals, kernel=None, domain=None, measure=None)[source]

Infer the value of an integral from a given set of nodes and function evaluations.

Parameters
Returns

  • integral – The integral belief subject to the provided measure or domain.

  • info – Information on the performance of the method.

Raises

ValueError – If neither a domain nor a measure are given.

Warns

When ``domain`` is given but not used.

Return type

Tuple[Normal, BQIterInfo]

See also

bayesquad

Computes the integral using an acquisition policy.

Examples

>>> import numpy as np
>>> domain = (0, 1)
>>> nodes = np.linspace(0, 1, 15)[:, None]
>>> fun_evals = nodes.reshape(-1, )
>>> F, info = bayesquad_from_data(nodes=nodes, fun_evals=fun_evals, domain=domain)
>>> print(F.mean)
0.5