R/bspline.R

Defines functions bspline

bspline <- function(x, xl, xr, ndx, bdeg){
	dx <- (xr - xl)/ndx
	knots <- seq(xl - bdeg*dx, xr + bdeg*dx, by=dx)
	B <- splines::spline.des(knots, x, bdeg+1, 0*x)$design
	res <- list(B = B, knots = knots)
	res
}
rominsal/sptpsar documentation built on June 1, 2022, 2:03 a.m.