Learn R Programming

fields (version 1.7.2)

splint: Cubic spline interpolation

Description

A fast, FORTRAN based function for cubic spline interpolation.

Usage

splint(x, y, xgrid, derivative=0)

Arguments

Value

A vector consisting of the spline evaluated at the grid values.

References

See Additive Models by Hastie and Tibshriani.

Details

Fits a piecewise interpolating cubic polynomial to the x and y values assuming that the second and third derivatives are zero at the range of the x values. For this reason extrapolation outside the range of the x values will be a linear function.

See Also

sreg, Tps

Examples

Run this code
x<- seq( 0, 120,,200)

splint(rat.diet$t, rat.diet$trt,x )-> y

plot( rat.diet$t, rat.diet$trt)
lines( x,y)
#( this is weird!)

Run the code above in your browser using DataLab