Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ranjanan/MonteCarloIntegration.jl
A package for multi-dimensional integration using monte carlo methods
https://github.com/ranjanan/MonteCarloIntegration.jl
monte-carlo-integration numerical-integration
Last synced: 3 months ago
JSON representation
A package for multi-dimensional integration using monte carlo methods
- Host: GitHub
- URL: https://github.com/ranjanan/MonteCarloIntegration.jl
- Owner: ranjanan
- License: mit
- Created: 2019-05-14T18:39:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-02-17T03:04:45.000Z (9 months ago)
- Last Synced: 2024-07-17T06:27:44.123Z (4 months ago)
- Topics: monte-carlo-integration, numerical-integration
- Language: Julia
- Homepage:
- Size: 63.5 KB
- Stars: 36
- Watchers: 4
- Forks: 17
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-sciml - ranjanan/MonteCarloIntegration.jl: A package for multi-dimensional integration using monte carlo methods
README
# Monte Carlo Integration
![CI](https://github.com/ranjanan/MonteCarloIntegration.jl/workflows/CI/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/ranjanan/MonteCarloIntegration.jl/badge.svg?branch=master)](https://coveralls.io/github/ranjanan/MonteCarloIntegration.jl?branch=master)This package provides multidimensional integration
algorithms based on monte carlo methods. The biggest
advantage of using monte carlo methods is that their
convergence rate is **independent of the dimension of
the integral**.Currently, this package only provides a routine
called VEGAS:vegas(f, st, en, kwargs...)
VEGAS is a Monte Carlo algorithm for
multidimensional integration based on
adaptive importance sampling. It divides
each dimension into bins and adaptively adjusts
bin widths so points are sampled from the
region where the function has highest magnitude.Arguments:
----------
- st: Array of starting values in each dimension.
Defaults to zeros(2)
- end: Array of ending values in each dimension.
Defaults to ones(2)Kwargs:
------
- nbins: Number of bins in each dimension.
Defaults to 100.
- ncalls: Number of function calls per iteration.
Defaults to 1000.
- maxiter: Maximum number of iterations.
Defaults to 100.
- rtol: Relative tolerance required.
Defaults to 1e-4.
- atol: Absolute tolerance required.
Defaults to 1e-2.
- debug: Prints `abs(sd/I)` every 100 iterations.
Defaults to false.
- batch: Whether `f` returns batches of function
evaluations. `f` is assumed to take one argument
`pts`, an `ncalls × ndims` matrix. Each row
is a unique point and returns an `ncalls` length
vector of function evals. This argument defaults
to false.Output:
------
- Estimate for the integral
- Standard deviation
- χ^2 / (numiter - 1): should be less than 1
otherwise integral estimate should not be trusted.References:
-----------
- Lepage, G. Peter. "A new algorithm for adaptive
multidimensional integration." Journal of
Computational Physics 27.2 (1978): 192-203.### Batch interface
Most of the computation time in an integration
algorithm is usually spent in function evaluations.
The batch inteface allows users to provide
batches of function evaluations, instead of supplying
a function directly to be integrated. Users can now
evaluate a number of points in parallel.### Roadmap
- Supporting vector valued functions
- Other integration algorithms