quadrature | R Documentation |
quadrature
computes the integral for a given function based on an NIGrid-object
quadrature(f, grid = NULL, ...)
f |
a function which takes the x-values as a (n x d) matrix as a first argument |
grid |
a grid of type |
... |
further arguments for the function |
The approximated value of the integral
createNIGrid
, rescale
myGrid <- createNIGrid(dim=2, type="GLe", level=5)
rescale(myGrid, domain=rbind(c(-1,1),c(-1,1)))
plot(myGrid, col="blue")
myFun <- function(x){
1 - x[,1]^2 * x[,2]^2
}
quadrature(myFun, myGrid)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.