Beispiel #1
0
 def test_normal(self):
     draws = dr.getNormalWichuraDraws(sampleSize=3, numberOfDraws=1000000)
     mean = np.linalg.norm(np.average(draws, axis=1))
     self.assertAlmostEqual(mean, 0, 2)
     draws = dr.getNormalWichuraDraws(sampleSize=3,
                                      numberOfDraws=1000000,
                                      antithetic=True)
     mean = np.linalg.norm(np.average(draws, axis=1))
     self.assertAlmostEqual(mean, 0, 5)
Beispiel #2
0
 def normal_MLHS_anti(sampleSize, numberOfDraws):
     unif = draws.getLatinHypercubeDraws(sampleSize,
                                         int(numberOfDraws / 2))
     return draws.getNormalWichuraDraws(sampleSize,
                                        numberOfDraws,
                                        uniformNumbers=unif,
                                        antithetic=True)
Beispiel #3
0
 def normal_MLHS(sampleSize, numberOfDraws):
     unif = draws.getLatinHypercubeDraws(sampleSize,
                                         numberOfDraws)
     return draws.getNormalWichuraDraws(sampleSize,
                                        numberOfDraws,
                                        uniformNumbers=unif,
                                        antithetic=False)
Beispiel #4
0
 def normal_halton5(sampleSize, numberOfDraws):
     unif = draws.getHaltonDraws(sampleSize,
                                 numberOfDraws,
                                 base=2,
                                 skip=10)
     return draws.getNormalWichuraDraws(sampleSize,
                                        numberOfDraws,
                                        uniformNumbers=unif,
                                        antithetic=False)
Beispiel #5
0
 def normal_antithetic(sampleSize, numberOfDraws):
     return draws.getNormalWichuraDraws(sampleSize=sampleSize,
                                        numberOfDraws=numberOfDraws,
                                        antithetic=True)