diffsvg.pp.compute_interior_knots#
- diffsvg.pp.compute_interior_knots(n_bsplines, degree=3)#
Interior knot positions (plus the
0/1endpoints) for a B-spline basis on[0, 1].For
patsy’sbs(x, knots=interior_knots, degree=degree, include_intercept=True)the number of resulting basis columns islen(interior_knots) + degree + 1, son_bsplinesinterior knots are chosen accordingly.- Parameters:
- n_bsplines
Desired number of B-spline basis functions.
- degree default:
3 Degree of the B-spline (3 = cubic).
- Returns:
numpy.ndarray Knot grid including the
0and1endpoints, i.e. the interior knots to pass topatsyareresult[1:-1].