Learn R Programming

chebpol (version 1.3-952)

polyh: Polyharmonic splines on scattered data

Description

Polyharmonic splines on scattered data.

Usage

polyh(val, knots, k=2, ...)

Arguments

val
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.

Examples

Run this code
# a function on a 20-dimensional space
f <- function(x) 10/(10+sum(sqrt(x)))
knots <- matrix(runif(16000), 20)
phs <- polyh(f, knots, 3)
# test it in a random point
a <- runif(20)
f(a); phs(a)

Run the code above in your browser using DataLab