Description Usage Arguments Details Value References See Also Examples
Implement a Monte Carlo algorithm for multidimensional numerical integration. This algorithm uses importance sampling as a variance-reduction technique. Vegas iteratively builds up a piecewise constant weight function, represented on a rectangular grid. Each iteration consists of a sampling step followed by a refinement of the grid.
1 2 3 4 5 6 |
ndim |
same as |
ncomp |
same as |
integrand |
same as |
... |
same as |
lower |
same as |
upper |
same as |
rel.tol |
same as |
abs.tol |
same as |
flags |
same as Note: Value 3 of |
min.eval |
same as |
max.eval |
same as |
nstart |
the number of integrand evaluations per iteration to start with. |
nincrease |
the increase in the number of integrand evaluations per iteration. The j-th iteration evaluates the integrand at nstart+(j-1)*nincrease points. |
nbatch |
Vegas samples points not all at once, but in batches of a predetermined size, to avoid
excessive memory consumption. |
gridno |
an integer. Vegas
may accelerate convergence to keep the grid accumulated during one integration for
the next one, if the integrands are reasonably similar to each other. Vegas maintains
an internal table with space for ten grids for this purpose.
If |
state.file |
the name of an external file. Vegas can store its entire internal state (i.e. all the information to resume an interrupted integration) in an external file. The state file is updated after every iteration. If, on a subsequent invocation, Vegas finds a file of the specified name, it loads the internal state and continues from the point it left off. Needless to say, using an existing state file with a different integrand generally leads to wrong results. Once the integration finishes successfully, i.e. the prescribed accuracy is attained, the state file is removed. This feature is useful mainly to define ‘check-points’ in long-running integrations from which the calculation can be restarted. |
See details in the documentation.
Idem as cuhre
, except from nregions
(not present)
G. P. Lepage (1978) A new algorithm for adaptive multidimensional integration. J. Comput. Phys., 27, 192-210.
G. P. Lepage (1980) VEGAS - An adaptive multi-dimensional integration program. Research Report CLNS-80/447. Cornell University, Ithaca, N.-Y.
T. Hahn (2005) CUBA-a library for multidimensional numerical integration. Computer Physics Communications, 168, 78-95.
1 2 3 4 5 6 7 8 |
Vegas input parameters:
ndim 3
ncomp 1
rel.tol 0.001
abs.tol 1e-12
smooth 0
pseudo.random 0
final 0
verbose 2
min.eval 0
max.eval 50000
nstart 1000
nincrease 500
vegas.gridno 0
vegas.state ""
Iteration 1: 1000 integrand evaluations so far
[1] 0.664916 +- 0.0138647 chisq 0 (0 df)
Iteration 2: 2500 integrand evaluations so far
[1] 0.664102 +- 0.00448861 chisq 0.0038488 (1 df)
Iteration 3: 4500 integrand evaluations so far
[1] 0.664341 +- 0.00174067 chisq 0.00717154 (2 df)
Iteration 4: 7000 integrand evaluations so far
[1] 0.665279 +- 0.000771133 chisq 0.368573 (3 df)
Iteration 5: 10000 integrand evaluations so far
[1] 0.664811 +- 0.000492177 chisq 0.990089 (4 df)
integral: 0.6648107 (+-0.00049)
number of evaluations: 10000; probability: 0.08870493
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.