| predict.dierckx {DierckxSpline} | R Documentation |
Evaluate the spline for a desired set of x values.
## S3 method for class 'dierckx': predict(object, newdata, ...)
object |
An object of class 'dierckx'. |
newdata |
an optional numeric vector at which 'dierckx' spline predictions are desired. |
... |
Ignored. |
if newdata is provided, evaluate the spline at newdata and return the predictions. Else, return fitted(object).
A numeric vector giving spline predictions for 'newdata' if provided or for each distinct level of 'x' in the spline fit.
Sundar Dorai-Raj and Spencer Graves
Dierckx, P. (1993) Curve and Surface Fitting with Splines, Oxford Science Publications.
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))