normcdf
The normcdf function calculates the normal cumulative distribution function (CDF).
Synopsis
normcdf(x,mean,std_dev)
Summary
The normal, or Gaussian, CDF with mean μ and standard deviation σ is:
Example
The standard normal distribution has μ = 0 and σ = 1. Any observation has a 0.5 probability of being greater than 0.
Â
Create a 1-dimensional array of size 10 called standard_array with a double attribute called standard, and fill it with values from -2.25 to 2.25:
AFL% store(build(<standard:double>[x=0:9], (x-4.5)/2.0), standard_array);
These values represent 2.25 standard deviations on either side of the mean.
Find the cumulative probability for each value in standard_array:
AFL% apply(standard_array, prob, normcdf(standard, 0, 1));
The output is:{x} standard,prob {0} -2.25,0.0122245 {1} -1.75,0.0400592 {2} -1.25,0.10565 {3} -0.75,0.226627 {4} -0.25,0.401294 {5} 0.25,0.598706 {6} 0.75,0.773373 {7} 1.25,0.89435 {8} 1.75,0.959941 {9} 2.25,0.987776
Note that approximately 97.5% of values fall within 2.25 standard deviations of the mean for the standard normal distribution.
Remove the example array:
AFL% remove(standard_array);
Inverse
inormcdf: Inverse normal CDF
Â