Bases: object

Numerical computation of an integral.

Compute the integral

$\int_\Omega f(x) \, \text{d} \mu(x)$

for a function $$f: \Omega \rightarrow \mathbb{R}$$ w.r.t. the measure $$\mu$$.

Parameters
• fun (Callable[[np.ndarray], np.ndarray]) – Function to be integrated. It needs to accept a shape=(n_eval, input_dim) np.ndarray and return a shape=(n_eval,) np.ndarray.

• measure (quad.integration_measures.IntegrationMeasure) – The integration measure.

• solution (Optional[Union[float, np.ndarray, randvars.RandomVariable]]) – Analytic value of the integral or precise numerical solution. Used for testing and benchmarking.

Examples

>>> import numpy as np