Created
November 11, 2013 15:27
-
-
Save iamjono/7414944 to your computer and use it in GitHub Desktop.
Box-Muller transform normal distribution method for Lasso 9
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
/* ============================================================ | |
See http://rosettacode.org/wiki/Statistics/Normal_distribution#Lasso | |
============================================================ */ | |
define normalDist(mean::decimal=0.5,sdev::decimal=0.2) => { | |
// Uses Box-Muller transform | |
return ((-2 * decimal_random->log)->sqrt * (2 * pi * decimal_random)->cos) * #sdev + #mean | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment