deriv.dierckx {DierckxSpline} | R Documentation |
Evaluates in a number of points x(i),i=1,2,...,m the derivative of order nu of a spline s(x) of degree k,given in its b-spline representation.
## S3 method for class 'dierckx': deriv(expr, at = NULL, order = 1, ...)
expr |
An object of class dierckx . |
at |
Optional numeric vector where the derivatives should be calculated. If missing, the initial abscissa values are used. |
order |
Order of the derivative of the derivative to calculate. Default is 1 (first derivative). Valid values are 0<=order<=k. |
... |
ignored |
A numeric vector the same length as at
containing the derivatives.
Sundar Dorai-Raj
Dierckx, P. (1991) Curve and Surface Fitting with Splines, Oxford Science Publications.
curfit
, integral.dierckx
, spline
, smooth.spline
x <- seq(0, 1, 0.1) y <- (1 - x)^3 z <- curfit(x, y, method = "ls", knots = seq(0, 1, 0.2), k = 3) plot(x, y, type = "p") lines(x, fitted(z), col = "blue") D1 <- deriv(z, order = 1) D2 <- deriv(~(1 - x)^3, "x", func = TRUE)(z$x) D3 <- numericDeriv(quote((1 - x)^3), "x") D4 <- -3 * (1 - z$x)^2 cbind(D1 = D1, D2 = attr(D2, "gradient")[, 1], D3 = diag(attr(D3, "gradient")), D4 = D4)