MHB How Does the DeBoor Algorithm Calculate Coefficients for Spline Fitting?

  • Thread starter Thread starter anjuantop
  • Start date Start date
  • Tags Tags
    Algorithm
Click For Summary
The discussion focuses on implementing the DeBoor algorithm for spline fitting, specifically addressing the confusion regarding the size of the COEF array in the BSPLPP subroutine. The COEF array is sized (k,l), which may seem incorrect for a kth degree polynomial that typically requires (k+1) coefficients. However, it is explained that the DeBoor algorithm calculates coefficients iteratively using a recurrence relation, necessitating an extra column in the array to accommodate coefficients for the (k+1)th degree polynomial. Consequently, the output in L2MAIN is sized (k+1,l) as it extracts coefficients for both the kth and (k+1)th degree polynomials, clarifying the initial confusion.
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
 
Technology 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.
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 27 ·
Replies
27
Views
6K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K