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

  • Thread starter Thread starter anjuantop
  • Start date Start date
  • Tags Tags
    Algorithm
AI Thread 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
27
Views
6K
Replies
7
Views
4K
Replies
13
Views
3K
Replies
3
Views
2K
Replies
4
Views
4K
Back
Top