Which is the machine precision of Matlab?
显示 更早的评论
Hi all, I have the following problem: I want to find the argmax (not necessarily unique) of a function f(alpha,beta). Under some assumptions on f it is possible to obtain the argmax set following this procedure:
1) compute F=max f(alpha,beta) wrto alpha and beta
2) for each alpha compute H(alpha)=max f(alpha,beta) with respect to beta
3) pick alpha s.t. H(alpha)=F;
4) pick corresponding beta from step 2)
I'm trying to perform this procedure in Matlab; my question is: assuming that the maximization problems have been correctly solved, how much the result given by Matlab is precise? i.e. in step 3) I should pick alpha s.t. H(alpha)~= F+...? or I should round the numbers to which digit?
I have attached F and H(alpha).
Thank you very much!
1 个评论
John D'Errico
2014-2-18
编辑:John D'Errico
2014-2-18
I'm intrigued here. At one point you state you know nothing of numerical analysis. At another point, you state that "under some assumptions on f, it is possible to obtain the argmax".
So which is it? You know nothing, or a fair amount?
By the way, as optimization schemes go, I'm not terribly impressed with this one.
This almost feels like your homework assignment, given the statement above, as if you were fed that line.
采纳的回答
更多回答(1 个)
Default in Matlab is double which is stored with 53 bits of precision. This converts to roughly 15-16 decimal digits of precision (log10(2^53)-->15.95).
5 个评论
Walter Roberson
2014-2-18
Notice that you still need to do standard numeric analysis to determine how much precision is carried around at each step. http://en.wikipedia.org/wiki/Propagation_of_uncertainty
MRC
2014-2-18
MRC
2014-2-18
John D'Errico
2014-2-18
I think dpb was asleep here. A double is stored with 53 BITS of precision, not 53 DIGITS as was stated at one point.
dpb
2014-2-18
Ooops...typo indeed, edited/corrected. Thanks for pointing it out...
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!