bundles / scipy 1.17.1 / scipy / integrate / _rules / _base / Rule / estimate_error
function
scipy.integrate._rules._base:Rule.estimate_error
Signature
def estimate_error ( self , f , a , b , args = () ) Summary
Estimate the error of the approximation for the integral of f in rectangular region described by corners a and b.
Extended Summary
If a subclass does not override this method, then a default error estimator is used. This estimates the error as |est - refined_est| where est is estimate(f, a, b) and refined_est is the sum of estimate(f, a_k, b_k) where a_k, b_k are the coordinates of each subregion of the region described by a and b. In the 1D case, this is equivalent to comparing the integral over an entire interval [a, b] to the sum of the integrals over the left and right subintervals, [a, (a+b)/2] and [(a+b)/2, b].
Parameters
f: callableFunction to estimate error for.
fmust have the signature::f(xndarray, *args) -> ndarray
fshould accept arraysxof shape::(npoints, ndim)
and output arrays of shape::
(npoints, output_dim_1, ..., output_dim_n)
In this case, estimate will return arrays of shape::
(output_dim_1, ..., output_dim_n)
a, b: ndarrayLower and upper limits of integration as rank-1 arrays specifying the left and right endpoints of the intervals being integrated over. Infinite limits are currently not supported.
args: tuple, optionalAdditional positional args passed to
f, if any.
Returns
err_est: ndarrayResult of error estimation. If
freturns arrays of shape(npoints, output_dim_1, ..., output_dim_n), thenestwill be of shape(output_dim_1, ..., output_dim_n).
Aliases
-
scipy.integrate._rules.Rule.estimate_error