Integration Of One-Dimensional Functions
一维函数的积分
在有限或无限区间上一元函数的自适应求积
integrate(f, lower, upper, …, subdivisions = 100L,
rel.tol = .Machine$double.eps^0.25, abs.tol = rel.tol,
stop.on.error = TRUE, keep.xy = FALSE, aux = NULL)
例
∫ − ∞ ∞ x exp { − ( y − x ) 2 − λ ∣ x ∣ } d x \int_{-\infin}^{\infin} x \exp\{-(y-x)^2-\lambda|x|\}dx ∫−∞∞xexp{−(y−x)2−λ∣x∣}dx
integrate(function(x) x*exp(-(y-x)^2/2-lambda*abs(x)),
lower = -Inf,
upper = Inf)$value