Displaying 1 result from an estimated 1 matches for "bslinegrid".
Did you mean:
bsplinegrid
2006 Dec 13
2
caching frequently used values
...<- list(nodes=1:8,order=4,grid=seq(2,5,by=.2))
I need the design matrix (computed by splineDesign) for various
derivatives (not necessarily known in advance), to be calculated by
the function
bsplinematrix <- function(bsplinegrid, deriv=0) {
x <- bsplinegrid$grid
Matrix(splineDesign(bslinegrid$knots, x, ord=basis$order,
derivs = rep(deriv,length(x))))
}
However, I don't want to call splineDesign all the time. A smart way
would be storing the calculated matrices in a list inside bsplinegrid.
Pseudocode would look like this:
bsplinematrix <- function(bspline...