Problem with fmincon in case of using variables have various order

3 views (last 30 days)
I have 3 parmeters (a, b,c )to be regressed for each n,m pair of components
the problem is that, the solver stay very close to intial guesses of a and b but in case of c it makes a good move.
my qustion is , is it posible that the solver focused on the c, becouse it ismakes the segnificat change on the equation? and why is that happend with fmincon ? and how can I solve this problem?

Answers (1)

Peter O
Peter O on 7 Jul 2021
Edited: Peter O on 7 Jul 2021
Ghost,
Good observations. Yes, c has the greatest sensitivity. Sometimes it's possible to get a better fit by massaging the inputs to the fit mathematically. In this case, you could take the natural logarithm of the output data if you're very sure in your measurement accuracy of ψ. Then you're fitting:
log(psi) = -a/T - b - c*T
which could be much better behaved because its inputs are an inverse term, a slope, and an intercept. Depending on the range of the data and how linear it appears, a could still be negligible, or it could be substantial. In this form you've got one term proportional to T, one that is inversely proportional to T, and a third one that sets the offset of the whole function, which might work pretty nice!
Again to hammer back on the measurement accuracy, by taking the logarithm, you're de-emphazing some of the variation across the output points to tease out some clearer behavior of the inputs. It's possible that the constants you obtain will be less effective against new data for the fitted curve -- it's always helpful to have a few extra points that don't contribute to the fit to test out its validity.
(Edit: Sign error)
  2 Comments
Ghost Mamo
Ghost Mamo on 7 Jul 2021
Thank you for your suggetion, which is could solve the problem, but not in mbeecause this is not the only equation I ahve and ψ is not my measurand, but this ist the ony equation has this effect on a,b,c , and I just want to simplify the problem, so I can't apply your suggestion.
Do you think if I change the solver , I will not get this problem? Is there any solver considering such this issue, because I don't think, I'm the only one facing with this problem
Peter O
Peter O on 7 Jul 2021
Do you have the constraint requirements that fmincon is designed to handle? From what you've posted, your coefficients appear free to vary. Try fsolve. You'll need to reformulate the expression to a function that outputs zero when perfectly converged, which for the equation above is:
f(x) = log(psi) + a/t+b+cT
You'll just need to look at your data to decide on a good initial guess for a, b, and c.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!