Problem with fmincon in case of using variables have various order

2 次查看(过去 30 天)
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?

回答(1 个)

Peter O
Peter O 2021-7-7
编辑:Peter O 2021-7-7
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 个评论
Ghost Mamo
Ghost Mamo 2021-7-7
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 2021-7-7
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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by