> I'm using the GSL B-spline functions to implement cubic spline smoothing. > My program is based on the example in the manual > (http://www.gnu.org/software/gsl/manual/html_node/Example-programs-for-B_002dsplines.html). > > I want to allow varying numbers of breakpoints (nbreak) to achieve different > degrees of smoothing. The minimum nbreak for cubic splines is 2, but is > there a maximum?
There should not be from the gsl_bspline routines. > If I use more than n-2 (where n is the number of data > points), I get an error from "gsl_multifit_wlinear" when computing the > spline coefficients: > gsl: svd.c:236: ERROR: svd of MxN matrix, M<N, is not implemented > > For the offending fit matrix, M = n and N = ncoeffs = nbreak+k-2 = nbreak+2. I'm not familiar with the svd routine. Someone else will have to jump in here. > Is there a way to use every (distinct location of a) data point as a > breakpoint (via "gsl_bspline_knots")? Yes, that should be possible if you get past the SVD constraint from above. In that case you're just fitting a cubic spline interpolant and you may wish to use http://www.gnu.org/software/gsl/manual/html_node/Interpolation.html > Would it be possible to have more breakpoints than data points? Probably, if you're working in a least squares sense. > If so, would it make any sense to allow this? I'm not sure that you'll gain anything. - Rhys _______________________________________________ Help-gsl mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gsl
