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 <- spline.des(knots, x, bdeg + 1, 0*x)$design
	res <- list(B = B, knots = knots)
	res
}

Try the pspatreg package in your browser

Any scripts or data that you put into this service are public.

pspatreg documentation built on Oct. 6, 2023, 5:06 p.m.