This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Returns the inverse of the standard normal cumulative distribution. | |
* The distribution has a mean of zero and a standard deviation of one. | |
* Resources: | |
* http://board.phpbuilder.com/showthread.php?10367349-PHP-NORMSINV | |
* http://www.source-code.biz/snippets/vbasic/9.htm | |
* @param integer $week number of week | |
* @return float sales | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Original C++ implementation found at http://www.wilmott.com/messageview.cfm?catid=10&threadid=38771 | |
/// C# implementation found at http://weblogs.asp.net/esanchez/archive/2010/07/29/a-quick-and-dirty-implementation-of-excel-norminv-function-in-c.aspx | |
/* | |
* Compute the quantile function for the normal distribution. | |
* | |
* For small to moderate probabilities, algorithm referenced | |
* below is used to obtain an initial approximation which is | |
* polished with a final Newton step. | |
* | |
* For very large arguments, an algorithm of Wichura is used. |