public double SampleMean(IDistribution distribution) { sample = SampleGenerator.GenerateSample(distribution, n); double sum = 0; foreach (double x in sample) { sum += x; } return(sum / n); }
public double Next(RandomBSV rand) { List <double> a = SampleGenerator.GenerateSample(rand, N); double x = 0.0; foreach (double element in a) { x += element; } x -= N / 2; x *= Math.Sqrt(12.0 / N); return(m + Math.Sqrt(s) * x); }