dmat | R Documentation |
Computes a derivative matrix for B-splines that can then be used for shape-constraints. It is internally called by shapeConstr and should not be used directly.
dmat(d, s, knots, ord)
d |
Non-negative integer giving the order of derivation. Should be between 0 and |
s |
Sign of the derivative. |
knots |
Vector of ordered knots from the spline bases. |
ord |
Non-negative integer giving the order of the spline. |
Does the heavy lifting in shapeConstr to create a constraint matrix for shape-constrained B-splines. Only useful for advanced users to create constraint matrices without passing an object to one of the shapeConstr methods.
A matrix of weighted differences that can be used to constrain B-spline bases.
dmat
doesn't perform any checks of the parameters so use carefully. In normal usage, checks are done by shapeConstr methods.
# A second derivative matrix for cubic B-Splines with regularly spaced knots
# Can be used to enforce convexity
cirls:::dmat(2, 1, 1:15, 4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.