Description Usage Arguments Details Value References See Also Examples
Implement a deterministic algorithm for multidimensional numerical
integration. Its algorithm uses one of several cubature rules in a
globally adaptive subdivision scheme.
The subdivision algorithm is similar to
suave
's.
1 2 3 4 5 |
ndim |
the number of dimensions of the integral. It should be less or equal to 40. |
ncomp |
the number of components of the integrand. It should be less or equal to 10. |
integrand |
the R function which computes the integrand. It is expected to be declared as
where
The value returned by this R function should be a vector of length
|
... |
optional additional parameters to be passed to
|
lower |
the lower bounds of the integration region.
Vector of length |
upper |
the upper bounds of the integration region.
Vector of length |
rel.tol |
the requested relative accuracy. Default, 0.001. |
abs.tol |
the requested absolute accuracy. The algorithm stops when either the relative or the absolute accuracies are met. Default, near 0 (the algorithm stops when the relative accuracy is met). |
flags |
flags governing the integration. A list with components: - - - when - the seed for the Mersenne Twister algorithm, when |
min.eval |
the minimum number of integrand evaluations required. |
max.eval |
the (approximate) maximum number of integrand evaluations allowed. |
key |
chooses the basic integration rule:
For other values, the default rule is taken, which is the degree-13 rule in 2 dimensions, the degree-11 rule in 3 dimensions, and the degree-9 rule otherwise. |
See details in the documentation.
A list of the S3-class cuba
with components:
method |
here, “cuhre” |
nregions |
the actual number of subregions needed. |
neval |
the actual number of integrand evaluations needed. |
ifail |
an error flag:
|
value |
vector of length |
abs.error |
vector of length |
prob |
vector of length |
message |
“OK” or a character string giving the error message. |
call |
The matched call. |
J. Berntsen, T. O. Espelid (1991) An adaptive algorithm for the approximate calculation of multiple integrals. ACM Transactions on Mathematical Software, 17(4), 437-451.
T. Hahn (2005) CUBA-a library for multidimensional numerical integration. Computer Physics Communications, 168, 78-95.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Cuhre input parameters:
ndim 3
ncomp 1
rel.tol 0.001
abs.tol 1e-12
pseudo.random 0
final 0
verbose 2
min.eval 0
max.eval 50000
key 0
Iteration 1: 127 integrand evaluations so far
[1] 0.66467 +- 7.2682e-10 chisq 0 (0 df)
Iteration 2: 381 integrand evaluations so far
[1] 0.66467 +- 3.33018e-11 chisq 0 (1 df)
integral: 0.6646697 (+-3.3e-11)
nregions: 2; number of evaluations: 381; probability: 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.