TABLE OF CONTENTS
CWrappers/csplinedesign [ Functions ]
NAME
csplinedesign --- wrapper for csplinedesign
FUNCTION
Computes a design matrix for the spline basis, by evaluating the set of order ord B-splines on the set of knots knots, at values x. Wraps the C implenentation of csplinedesign, which works identically to splineDesign from the splines package, but faster.
SYNOPSIS
3162 csplinedesign <- function(knots, x, ord)
INPUTS
knots vector of knots x points at which the basis should be evaluated. ord order of the spline
OUTPUTS
des matrix, whose (i,j) entry is spline j evaluated at x[i]
SOURCE
3165 { 3166 K <- length(knots) - 2 * ord 3167 design <- matrix(0, length(x), K + ord) 3168 out <- .C("csplinedesign", 3169 des = as.double(design), 3170 x = as.double(x), 3171 nx = as.integer(length(x)), 3172 knots = as.double(knots), 3173 ord = as.integer(ord), 3174 K = as.integer(K) 3175 ) 3176 des <- matrix(out$des, length(x), K + ord) 3177 return(des) 3178 }