![]() ![]() The screenshots below show the following results for polynomials fitted to the test function: I will post more details of this, including a download file with open source code, in a future post. I have written an Excel VBA User Defined Function (UDF) to call the ALGLIB function directly from the spreadsheet. ![]() This is specifically intended to fit a polynomial to scattered data, using a least squares method. Using the ALGLIB “PolynomialFit” fit routine.Using the function provided by Lori Miller in the comments: =MMULT(MMULT(TRANSPOSE(Y),X^N),MINVERSE(MMULT(TRANSPOSE(X^N),X^N))).Using the xy chart trend line for polynomials up to 6th order.Using the LINEST function: =LINEST(YRange, XRange^.It should be emphasised that high order polynomials are completely inappropriate for interpolating a function such as this it was chosen purely because it shows up the differences in the results from the four different methods examined. In order to investigate this I have looked at fitting polynomials of different degree to the function y = 1/(x – 4.99) over the range x = 5 to x = 6. Scott found that he was getting different results from Linest and the xy chart trend line for polynomials of order 5 and 6 (6th order being the highest that can be displayed with the trend line). This post is a follow up to Using LINEST for non-linear curve fitting and the following comments from Scott Rogers and Lori Miller. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |