IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Meta.Numerics.Analysis.MultiFunctionMath Class Reference

Contains methods for the analysis of multi-dimensional functions. More...

Static Public Member Functions

static MultiExtremum FindGlobalMinimum (Func< IList< double >, double > function, IList< Interval > volume)
 
static MultiExtremum FindGlobalMinimum (Func< IList< double >, double > function, IList< Interval > volume, EvaluationSettings settings)
 
static MultiExtremum FindGlobalMaximum (Func< IList< double >, double > function, IList< Interval > volume)
 
static MultiExtremum FindGlobalMaximum (Func< IList< double >, double > function, IList< Interval > volume, EvaluationSettings settings)
 
static MultiExtremum FindMinimum (Func< IList< double >, double > function, IList< double > start)
 Finds a local minimum of a multi-dimensional function in the vincinity of the given starting location. More...
 
static MultiExtremum FindMinimum (Func< IList< double >, double > function, IList< double > start, EvaluationSettings settings)
 Finds a local minimum of a multi-dimensional function in the vincinity of the given starting location, subject to the given evaluation constraints. More...
 
static MultiExtremum FindMaximum (Func< IList< double >, double > function, IList< double > start, EvaluationSettings settings)
 Finds a local maximum of a multi-dimensional function in the vincinity of the given starting location, subject to the given evaluation constraints. More...
 
static IntegrationResult Integrate (Func< IList< double >, double > function, IList< Interval > volume)
 Estimates a multi-dimensional integral. More...
 
static IntegrationResult Integrate (Func< IList< double >, double > function, IList< Interval > volume, EvaluationSettings settings)
 Estimates a multi-dimensional integral using the given evaluation settings. More...
 

Static Private Member Functions

static
DifferentialEvolutionSettings 
GetDefaultSettings (EvaluationSettings settings, int d)
 
static MultiExtremum FindGlobalExtremum (MultiFunctor f, IList< Interval > volume, DifferentialEvolutionSettings settings)
 
static EvaluationSettings GetDefaultOptimizationSettings (int d)
 
static MultiExtremum FindMinimum_ModelTrust (MultiFunctor f, IList< double > x, double s, EvaluationSettings settings)
 
static UncertainValue Integrate_Adaptave (MultiFunctor f, CoordinateTransform[] map, IntegrationRegion r, EvaluationSettings settings)
 
static UncertainValue Integrate_MonteCarlo (MultiFunctor f, CoordinateTransform[] map, IList< Interval > box, EvaluationSettings settings)
 
static double Integrate_MonteCarlo_Cycle (MultiFunctor f, CoordinateTransform[] map, VectorGenerator g, LePageGrid grid, int n)
 

Private Attributes

const double mutationFactor = 0.625
 

Detailed Description

Contains methods for the analysis of multi-dimensional functions.

Member Function Documentation

static DifferentialEvolutionSettings Meta.Numerics.Analysis.MultiFunctionMath.GetDefaultSettings ( EvaluationSettings  settings,
int  d 
)
inlinestaticprivate
static MultiExtremum Meta.Numerics.Analysis.MultiFunctionMath.FindGlobalMinimum ( Func< IList< double >, double >  function,
IList< Interval volume,
EvaluationSettings  settings 
)
inlinestatic
static MultiExtremum Meta.Numerics.Analysis.MultiFunctionMath.FindGlobalMaximum ( Func< IList< double >, double >  function,
IList< Interval volume 
)
inlinestatic
static MultiExtremum Meta.Numerics.Analysis.MultiFunctionMath.FindGlobalMaximum ( Func< IList< double >, double >  function,
IList< Interval volume,
EvaluationSettings  settings 
)
inlinestatic
static MultiExtremum Meta.Numerics.Analysis.MultiFunctionMath.FindGlobalExtremum ( MultiFunctor  f,
IList< Interval volume,
DifferentialEvolutionSettings  settings 
)
inlinestaticprivate
static MultiExtremum Meta.Numerics.Analysis.MultiFunctionMath.FindMinimum ( Func< IList< double >, double >  function,
IList< double >  start 
)
inlinestatic
static EvaluationSettings Meta.Numerics.Analysis.MultiFunctionMath.GetDefaultOptimizationSettings ( int  d)
inlinestaticprivate
static MultiExtremum Meta.Numerics.Analysis.MultiFunctionMath.FindMinimum ( Func< IList< double >, double >  function,
IList< double >  start,
EvaluationSettings  settings 
)
inlinestatic

Finds a local minimum of a multi-dimensional function in the vincinity of the given starting location, subject to the given evaluation constraints.

Parameters
functionThe multi-dimensional function to minimize.
startThe starting location for the search.
settingsThe evaluation settings that govern the search for the minimum.
Returns
The local minimum.
static MultiExtremum Meta.Numerics.Analysis.MultiFunctionMath.FindMaximum ( Func< IList< double >, double >  function,
IList< double >  start,
EvaluationSettings  settings 
)
inlinestatic

Finds a local maximum of a multi-dimensional function in the vincinity of the given starting location, subject to the given evaluation constraints.

Parameters
functionThe multi-dimensional function to maximize.
startThe starting location for the search.
settingsThe evaluation settings that govern the search for the maximum.
Returns
The local maximum.
static MultiExtremum Meta.Numerics.Analysis.MultiFunctionMath.FindMinimum_ModelTrust ( MultiFunctor  f,
IList< double >  x,
double  s,
EvaluationSettings  settings 
)
inlinestaticprivate
static IntegrationResult Meta.Numerics.Analysis.MultiFunctionMath.Integrate ( Func< IList< double >, double >  function,
IList< Interval volume 
)
inlinestatic

Estimates a multi-dimensional integral.

Parameters
functionThe function to integrate.
volumeThe volume over which to integrate.

By default, our multidimensional integration system targets a relative accuracy of about 10-7 (close to full single precision) for d=2, falling gradually to about 10-2 (1%) for d=12. To achieve that accuracy, it allows up to about 105 evaluations of the integrand for d=2, rising up to about 108 evaluations for d=12.

You can change the accuracy demands and evaluation budget by passing an EvaluationSettings object to the integration method. By decreasing the accuracy you require or increasing the evaluation budget, you may be able to successfully complete integrals that would fail for the default settings.

Referenced by Test.MultiIntegrateTest.BallVolumeIntegrals(), Test.MultiIntegrateTest.BoxIntegralB(), Test.MultiIntegrateTest.BoxIntegralD(), Test.MultiIntegrateTest.DoubleIntegrals(), Test.MultiIntegrateTest.GaussianIntegrals(), Test.MultiIntegrateTest.IsingIntegrals(), Test.MultiIntegrateTest.RambleIntegral(), Test.MultiIntegrateTest.SeperableIntegrals(), Test.MultiIntegrateTest.SteinmetzVolume(), Test.MultiIntegrateTest.WatsonIntegrals(), and Test.MultiIntegrateTest.ZetaIntegrals().

static IntegrationResult Meta.Numerics.Analysis.MultiFunctionMath.Integrate ( Func< IList< double >, double >  function,
IList< Interval volume,
EvaluationSettings  settings 
)
inlinestatic

Estimates a multi-dimensional integral using the given evaluation settings.

Parameters
functionThe function to be integrated.
volumeThe volume over which to integrate.
settingsThe integration settings.
Returns
A numerical estimate of the multi-dimensional integral.

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 Double.PositiveInfinity and/or Double.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 of [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 function that is 1 inside the sphere and 0 outside it.
Exceptions
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.

References Meta.Numerics.Analysis.EvaluationSettings.AbsolutePrecision, Meta.Numerics.Interval.FromEndpoints(), Meta.Numerics.Interval.LeftEndpoint, Meta.Numerics.Analysis.EvaluationSettings.RelativePrecision, Meta.Numerics.Interval.RightEndpoint, Meta.Numerics.UncertainValue.Uncertainty, and Meta.Numerics.UncertainValue.Value.

static UncertainValue Meta.Numerics.Analysis.MultiFunctionMath.Integrate_Adaptave ( MultiFunctor  f,
CoordinateTransform[]  map,
IntegrationRegion  r,
EvaluationSettings  settings 
)
inlinestaticprivate
static UncertainValue Meta.Numerics.Analysis.MultiFunctionMath.Integrate_MonteCarlo ( MultiFunctor  f,
CoordinateTransform[]  map,
IList< Interval box,
EvaluationSettings  settings 
)
inlinestaticprivate
static double Meta.Numerics.Analysis.MultiFunctionMath.Integrate_MonteCarlo_Cycle ( MultiFunctor  f,
CoordinateTransform[]  map,
VectorGenerator  g,
LePageGrid  grid,
int  n 
)
inlinestaticprivate

Member Data Documentation

const double Meta.Numerics.Analysis.MultiFunctionMath.mutationFactor = 0.625
private

The documentation for this class was generated from the following files: