C# Class Accord.Math.Integration.MonteCarloIntegration

Monte Carlo method for multi-dimensional integration.

In mathematics, Monte Carlo integration is a technique for numerical integration using random numbers. It is a particular Monte Carlo method that numerically computes a definite integral. While other algorithms usually evaluate the integrand at a regular grid, Monte Carlo randomly choose points at which the integrand is evaluated. This method is particularly useful for higher-dimensional integrals. There are different methods to perform a Monte Carlo integration, such as uniform sampling, stratified sampling and importance sampling.

Inheritance: INumericalIntegration, IMultidimensionalIntegration
Show file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
Clone ( ) : object

Creates a new object that is a copy of the current instance.

Compute ( ) : bool

Computes the area of the function under the selected Range. The computed value will be available at this object's Area.

Integrate ( double>.Func func, double a, double b, int samples ) : double

Computes the area under the integral for the given function, in the given integration interval, using a Monte Carlo integration algorithm.

Integrate ( double>.Func func, double a, double b ) : double

Computes the area of the function under the selected Range. The computed value will be available at this object's Area.

Integrate ( double>.Func func, double a, double b, int samples ) : double

Computes the area of the function under the selected Range. The computed value will be available at this object's Area.

MonteCarloIntegration ( int parameters ) : System

Constructs a new Monte Carlo integration method.

MonteCarloIntegration ( int parameters, double>.Func function ) : System

Constructs a new Monte Carlo integration method.

Reset ( ) : void

Manually resets the previously computed area and error estimates, so the integral can be computed from scratch without reusing previous computations.

Method Details

Clone() public method

Creates a new object that is a copy of the current instance.
public Clone ( ) : object
return object

Compute() public method

Computes the area of the function under the selected Range. The computed value will be available at this object's Area.
public Compute ( ) : bool
return bool

Integrate() public static method

Computes the area under the integral for the given function, in the given integration interval, using a Monte Carlo integration algorithm.
public static Integrate ( double>.Func func, double a, double b, int samples ) : double
func double>.Func The unidimensional function whose integral should be computed.
a double The beginning of the integration interval.
b double The ending of the integration interval.
samples int The number of points that should be sampled.
return double

Integrate() public static method

Computes the area of the function under the selected Range. The computed value will be available at this object's Area.
public static Integrate ( double>.Func func, double a, double b ) : double
func double>.Func
a double
b double
return double

Integrate() public static method

Computes the area of the function under the selected Range. The computed value will be available at this object's Area.
public static Integrate ( double>.Func func, double a, double b, int samples ) : double
func double>.Func
a double
b double
samples int
return double

MonteCarloIntegration() public method

Constructs a new Monte Carlo integration method.
public MonteCarloIntegration ( int parameters ) : System
parameters int The number of parameters expected by the integrand.
return System

MonteCarloIntegration() public method

Constructs a new Monte Carlo integration method.
public MonteCarloIntegration ( int parameters, double>.Func function ) : System
parameters int The number of parameters expected by the .
function double>.Func The function to be integrated.
return System

Reset() public method

Manually resets the previously computed area and error estimates, so the integral can be computed from scratch without reusing previous computations.
public Reset ( ) : void
return void