predict.dierckx {DierckxSpline}R Documentation

Predict method for object of class 'dierckx'.

Description

Evaluate the spline for a desired set of x values.

Usage

  ## S3 method for class 'dierckx':
  predict(object, newdata, ...)

Arguments

object An object of class 'dierckx'.
newdata an optional numeric vector at which 'dierckx' spline predictions are desired.
... Ignored.

Details

if newdata is provided, evaluate the spline at newdata and return the predictions. Else, return fitted(object).

Value

A numeric vector giving spline predictions for 'newdata' if provided or for each distinct level of 'x' in the spline fit.

Author(s)

Sundar Dorai-Raj and Spencer Graves

References

Dierckx, P. (1993) Curve and Surface Fitting with Splines, Oxford Science Publications.

See Also

curfit

Examples

x <- 0:24
y <- c(1.0,1.0,1.4,1.1,1.0,1.0,4.0,9.0,13.0,
       13.4,12.8,13.1,13.0,14.0,13.0,13.5,
       10.0,2.0,3.0,2.5,2.5,2.5,3.0,4.0,3.5)
fitSS0 <- curfit(x, y, s=0)
predict(fitSS0, seq(2, 3, length=5))

[Package DierckxSpline version 1.0-9 Index]