When using the normcdf(Z,0,1), how does matlab compute the result for say normcdf(1.645,0,1)=.95? Does matlab use a table or calculate the values numerically, if calculated numerically how is this done?
2 views (last 30 days)
Show older comments
I am just curious about the method used to preform this task
0 Comments
Answers (2)
John D'Errico
on 1 Feb 2016
Edited: John D'Errico
on 1 Feb 2016
No. It does not use a table. normcdf uses a transformation to a special function in mathematics: erfc. Note that you can look at the code of normcdf.
Erfc as a special function has no analytical simple form that can be evaluated directly. It is not just a polynomial. It is an integral, that is then evaluated using a variety of numerical approximations, chosen to yield high accuracy, but to still be fast to evaluate.
If you wish more details on this, I would start with the bible of such things: Abramowitz and Stegun (a book that is such a classic that everybody refers to it simply by the authors.)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!