Monte Carlo Integrator
Module containing Monte Carlo integrator.
- raises ValueError:
Lower and upper bounds are of different dimensions.
- return:
Approximate integral value
- rtype:
float
- monte.monte_carlo_integrator.integrator(integrand, lower_bounds, upper_bounds, n)[source]
Integrates n-dimensional function using Monte Carlo simulation
- Parameters:
integrand (function) – Integrand, function to be integrated
lower_bounds (ndarray) – Lower bound(s) of the integration region
upper_bounds (ndarray) – Upper bound(s) of the integration region
n (int) – Number of simulation samples
- Raises:
ValueError – Error raised if bounds provided are of different dimensions
- Returns:
Estimated integral value
- Return type:
float