Click or drag to resize
MultiFunctionMathIntegrate Method (FuncIListDouble, Double, IListInterval, EvaluationSettings)
Estimates a multi-dimensional integral using the given evaluation settings.

Namespace:  Meta.Numerics.Analysis
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 3.1.0.0 (3.1.0.0)
Syntax
public static IntegrationResult Integrate(
	Func<IList<double>, double> function,
	IList<Interval> volume,
	EvaluationSettings settings
)

Parameters

function
Type: SystemFuncIListDouble, Double
The function to be integrated.
volume
Type: System.Collections.GenericIListInterval
The volume over which to integrate.
settings
Type: Meta.Numerics.AnalysisEvaluationSettings
The integration settings.

Return Value

Type: IntegrationResult
A numerical estimate of the multi-dimensional integral.
Exceptions
ExceptionCondition
ArgumentExceptionfunction, volume, or settings are null, or the dimension of volume is larger than 12.
NonconvergenceExceptionThe prescribed accuracy could not be achieved with the given evaluation budget.
Remarks

Note that the integration function must not attempt to modify the argument passed to it.

Note that the integration volume must be a hyper-rectangle. You can integrate over regions with more complex boundaries by specifying the integration volume as a bounding hyper-rectangle that encloses your desired integration region, and returing the value 0 for the integrand outside of the desired integration region. For example, to find the volume of a unit d-sphere, you can integrate a function that is 1 inside the unit d-sphere and 0 outside it over the volume [-1,1]d. You can integrate over infinite volumes by specifing volume endpoints of PositiveInfinity and/or NegativeInfinity. Volumes with dimension greater than 12 are not currently supported.

Integrals with hard boundaries (like our hyper-sphere volume problem) typically require more evaluations than integrals of smooth functions to achieve the same accuracy. Integrals with canceling positive and negative contributions also typically require more evaluations than integtrals of purely positive functions.

Numerical multi-dimensional integration is computationally expensive. To make problems more tractable, keep in mind some rules of thumb:

  • Reduce the required accuracy to the minimum required. Alternatively, if you are willing to wait longer, increase the evaluation budget.
  • Exploit symmetries of the problem to reduce the integration volume. For example, to compute the volume of the unit d-sphere, it is better to integrate over [0,1]d and multiply the result by 2d than to simply integrate over [-1,1]d.
  • Apply analytic techniques to reduce the dimension of the integral. For example, when computing the volume of the unit d-sphere, it is better to do a (d-1)-dimesional integral over the function that is the height of the sphere in the dth dimension than to do a d-dimensional integral over the indicator function that is 1 inside the sphere and 0 outside it.
See Also