Learn R Programming

chebpol (version 2.1-2)

slappx: 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.

Examples

Run this code
# 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))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab