[Math] cumulative standard normal distribution formula

normal distributionstatistics

I need to calculate a P-value (for significance checking) out of the Z value, mean(0), standarddeviation(1), normal distrubution being cummulative.

Is there a function in PHP that could do that?

This is my current code:

$P_value = (1/sqrt(2*pi()))*exp(-0.5*pow($this->ZValue,2));

ZValue = -4,688072309 which is confirmed the right value.

Expected value: 1,37895E-06

Value: 6.9681241978373E-6

used formula:

\phi (x)={\frac  {1}{{\sqrt  {2\pi }}}}\,e^{{-{\frac  12}x^{2}}}

I am searching for the cumulative standard normal distribution formula so I can insert it in PHP.

Best Answer

Here is a quick example in c++ of an implementation. Let me know if it helps. If not I will remove the answer :).

Method for computing the cumulative distribution