Description Usage Arguments Value Author(s) References See Also Examples
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.
1 2 |
expr |
An object of class |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.