qoiqpwqr 发表于 2010-12-16 11:53
cubature包 adaptIntegrate函数
看帮助找具体用法吧。
恩,好东西,先收藏了。
I.2d <- function(x) {
x1 = x[1]
x2 = x[2]
sin(4*x1+1) * cos(4*x2) * x1 * (x1*(x1*x1)^2 - x2*(x2*x2 - x1) +2)
}
adaptIntegrate(I.2d, rep(-1, 2), rep(1, 2), maxEval=10000)
UsageadaptIntegrate(f, lowerLimit, upperLimit, tol = 1e-05, fDim = 1, maxEval = 0, absError=0)Arguments
f | The function (integrand) to be integrated |
lowerLimit | The lower limit of integration, a vector for hypercubes |
upperLimit | The upper limit of integration, a vector for hypercubes |
tol | The maximum tolerance, default 1e-5. |
fDim | The dimension of the integrand, default 1, bears no relation to the dimension of the hypercube |
maxEval | The maximum number of function evaluations needed, default 0 implying no limit |
absError | The maximum absolute error tolerated |