neville: Neville's Method

Description Usage Arguments Details Value References See Also Examples

View source: R/neville.R

Description

Neville's's method of polynomial interpolation.

Usage

1
neville(x, y, xs)

Arguments

x, y

x-, y-coordinates of data points defining the polynomial.

xs

single point to be interpolated.

Details

Straightforward implementation of Neville's method; not yet vectorized.

Value

Interpolated value at xs of the polynomial defined by x,y.

References

Each textbook on numerical analysis.

See Also

newtonInterp, barylag

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
p <- Poly(c(1, 2, 3))
fp <- function(x) polyval(p, x)

x <- 0:4; y <- fp(x)
xx <- linspace(0, 4, 51)
yy <- numeric(51)
for (i in 1:51) yy[i] <- neville(x, y, xx[i])

## Not run: 
ezplot(fp, 0, 4)
points(xx, yy)
## End(Not run)

Example output



pracma documentation built on Dec. 11, 2021, 9:57 a.m.