The 2nd derivative matrix of the B-spline basis should be (delta.T @ w^(-1)) @ delta, not (delta.T @ w) @ delta. The formula can be fond in the book "Nonparametric Regression and Generalized Linear Models A roughness penalty approach" by P.J. Green, Bernard. W. Silverman, page 25
The 2nd derivative matrix of the B-spline basis should be (delta.T @ w^(-1)) @ delta, not (delta.T @ w) @ delta. The formula can be fond in the book "Nonparametric Regression and Generalized Linear Models A roughness penalty approach" by P.J. Green, Bernard. W. Silverman, page 25