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)
I am just curious about the method used to preform this task

Answers (2)

John D'Errico
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.)
  1 Comment
Jonathan Hill
Jonathan Hill on 1 Feb 2016
I tried to look at the code, but i wasn't able to find it within the Matlab files. I knew that if it didn't use a table of some sort that there would be some kind of numerical approximations for the integral that dictates the normal distribution. If you know how to find the file within Matlab could you point me in the right direction?

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!