slappx: Simplex Linear approximation on scattered data

Description Usage Arguments Value Note Examples

View source: R/simplexlinear.R

Description

A call fun <- slappx(val, knots) creates a piecewise multilinear interpolation on the Delaunay triangulation of the knots.

Usage

1

Arguments

...

Further arguments to the function, if is.function(val).

val

Array or function. Function values in the knots, or the function itself.

knots

matrix. Each column is a point in M-dimensional space.

Value

A function(x) interpolating the values.

Note

By default, the interpolant will yield NaN for points outside the convex hull of the knots, but some extrapolation will be returned instead if the interpolant is called with the argument epol=TRUE.

Examples

1
2
3
4
5
6
7
8
## Not run: 
knots <- matrix(runif(3*1000), 3)
f <- function(x) exp(-sum(x^2))
g <- slappx(f, knots)
a <- matrix(runif(3*6), 3)
rbind(true=apply(a,2,f), sl=g(a))

## End(Not run)

chebpol documentation built on Dec. 9, 2019, 5:08 p.m.