R: Simplex Linear approximation on scattered data

slappx {chebpol} | R Documentation

## Simplex Linear approximation on scattered data

### Description

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

### Usage

    slappx(...)

### 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

    ## 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)

[Package chebpol version 2.1-2 Index]