Variables Gaussianas Aleatorias


¿Hay una clase en la biblioteca estándar de. NET que me da la funcionalidad para crear variables aleatorias que siguen la distribución gaussiana?

Author: BartoszKP, 0000-00-00

1 answers

La sugerencia de Jarrett de usar una transformación Box-Muller es buena para una solución rápida y sucia. Una implementación simple:

Random rand = new Random(); //reuse this if you are generating many
double u1 = 1.0-rand.NextDouble(); //uniform(0,1] random doubles
double u2 = 1.0-rand.NextDouble();
double randStdNormal = Math.Sqrt(-2.0 * Math.Log(u1)) *
             Math.Sin(2.0 * Math.PI * u2); //random normal(0,1)
double randNormal =
             mean + stdDev * randStdNormal; //random normal(mean,stdDev^2)
 152
Author: yoyoyoyosef,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2017-01-30 14:58:59