Learn R Programming

SimplicialCubature (version 1.0)

grnmol: Grundmann-Moller integration of a function over a simplex

Description

Computes an approximation to the integral of a function f(x) over a simplex S. This is an R translation of the matlab function grnmol.m which was written by Alan Genz.

Usage

grnmol(f,V,s)

Arguments

Value

Qa vector of length s+1, with Q[i] the i-th degree approximate value of the integralnvnumber of function evaluations used

Details

The Grundmann-Moller algorithm approximates the integral of f(x) over the simplex V. When f(x) is a polynomial, and s is large enough, the integral is exact. This function is called by integrateSimplexPolynomial.

References

See reference by Grundmann and Moller in SimplicialCubature-package.

Examples

Run this code
f <- function( x ) { x[1]^2*x[4]^5 }
grnmol( f, CanonicalSimplex(4), s=4 )

Run the code above in your browser using DataLab