0
$\begingroup$

I'm using Matlab's curve fitting app, When I select Power fitting it returns values which perfectly describe the data but when I use the custom equation and enter ax^b as the equation it returns very bad coefficients. Shouldn't the results be the same?

I need to fit a data to a $ax^{-6} + bx^{-4} + cx^{-2}$ function so I need to use custom equation.

EDIT: Added the screenshots.

enter image description here enter image description here

$\endgroup$
1
$\begingroup$

I think your value of $y$ is too small. So, when the sum of squares is calculated it is already below the threshold, and the coefficients are accepted as good ones.

And the power function is fitted differently. $log(y) = log(a) + x*log(b)$ is a linear regression that has a direct formula. While when you input it manually it is something close to gradient decent to minimize sum is squares.

I do not know Matlab well, but you can multiply $y$ by $10^6$ and fit the curve. Then the real $a$ coefficient is $a/10^6$. Or try clicking fit options button and search the threshold value there.

$\endgroup$
2
  • $\begingroup$ Yes they are. So how should I increase this threshold? $\endgroup$ – Alireza Oct 29 '18 at 7:26
  • 1
    $\begingroup$ I do not know Matlab well, but you can multiply y by 10^6 and fit the curve. Then the real a coefficient is a/10^6. Or try clicking fit options button and search the threshold value there. $\endgroup$ – keiv.fly Oct 29 '18 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.