How Does the DeBoor Algorithm Calculate Coefficients for Spline Fitting?

  • Context:
  • Thread starter Thread starter anjuantop
  • Start date Start date
  • Tags Tags
    Algorithm
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
anjuantop
Messages
1
Reaction score
0
Hi,

I'm trying to implement the DeBoor algorithm for Spline fitting to data points. In the subroutine BSPLPP (which is used to convert the B representation to PP representation), the COEF array is of the size (k,l). But for a kth degree polynomial, the number of coefficients should be (k+1). I can not understand how the complete algorithm still gives an output of size (k+1,l) in L2MAIN. Please give me some pointers, if possible.

Thanks and Regards,
Anju
 
Physics news on Phys.org


Hello Anju,

Thank you for reaching out about your question regarding the DeBoor algorithm for Spline fitting. I can understand your confusion about the size of the COEF array in the BSPLPP subroutine. While it may seem counterintuitive that the array is of size (k,l) instead of (k+1,l) for a kth degree polynomial, this is actually due to the way the DeBoor algorithm calculates the coefficients.

In the DeBoor algorithm, the coefficients are calculated iteratively using a recurrence relation. This means that the coefficients for a kth degree polynomial are dependent on the coefficients of a (k-1)th degree polynomial. Therefore, the COEF array needs to have an extra column to store the coefficients for the (k+1)th degree polynomial.

In L2MAIN, the final output is obtained by extracting the coefficients for the kth degree polynomial from the (k+1)th column of the COEF array. This is why the output has a size of (k+1,l), as it includes the coefficients for both the kth and (k+1)th degree polynomials.

I hope this helps clarify your understanding of the DeBoor algorithm and its implementation in the BSPLPP subroutine. Please let me know if you have any further questions or need more clarification.