array or function. Function values on scattered data, or the function
itself.
knots
matrix. Each column is a point in a multidimensional space.
k
positive integer or negative numeric. The degree of the polyharmonic spline.
...
Further arguments to the function, if is.function(val).
Value
A function(x) defined on the multidimensional space, approximating the given
function.
concept
Polyharmonic splines
Details
polyh fits a polyharminc spline with radial basis function x^k for odd
k, and x^k log(x) for even k. If k < 0,
the basis exp(k x^2) is used. There are more details in a vignette.
If val is a function it will be evaluated on the knots.
# a function on a 20-dimensional spacef <- function(x) 10/(10+sum(sqrt(x)))
knots <- matrix(runif(16000), 20)
phs <- polyh(f, knots, 3)
# test it in a random pointa <- runif(20)
f(a); phs(a)