Is there a C++ library that implement similarly as in function Fit designating specific bi-variable polynomial form and then find fit coefficients?

조회 수: 22 (최근 30일)
Is there a C++ library that implement similarly as in function Fit designating specific bi-variable polynomial form and then find fit coefficients?
ie
g = fittype( @(a,b,c,x,y) a*x.^2+b*x.*y+c*y.^2 ), ...
'independent', {'x', 'y'}, ...
'dependent', 'z' );
Is there such a C++ library also able to desianate specific bi-variable polynomial form?(up to 20th polynomial) I find it rather slow when it comes to high order polynomial using matlab Fit and want to find some C++ libs to accelerate such process.
  댓글 수: 1
Steven Lord
Steven Lord 2019년 8월 28일
(up to 20th polynomial)
That smells a bit fishy. Does the underlying problem have some physical reason you expect the data to be fit well by such a high order polynomial or are you using up to a 20th order polynomial because you can? As Jeff Goldblum's character Ian Malcolm said in Jurassic Park, "Your scientists were so preoccupied with whether they could that they didn’t stop to think if they should."
What is the range of x and y data you're planning to pass into this fit object? Are you likely to encounter loss of significance when adding and subtracting multiples of x^20 and y^20?

댓글을 달려면 로그인하십시오.

답변 (1개)

Gaurav Garg
Gaurav Garg 2019년 8월 28일
Hi,
I understand that you wish to know a C++ library that is faster than fittype function in MATLAB for higher order polynomial equations. You can use cmath library in C++, where you can create a coefficient matrix, perform gaussian elimination and then back-substitute the values to get the final answer.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by