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)
def normal_MLHS_anti(sampleSize, numberOfDraws): unif = draws.getLatinHypercubeDraws(sampleSize, int(numberOfDraws / 2)) return draws.getNormalWichuraDraws(sampleSize, numberOfDraws, uniformNumbers=unif, antithetic=True)
def normal_MLHS(sampleSize, numberOfDraws): unif = draws.getLatinHypercubeDraws(sampleSize, numberOfDraws) return draws.getNormalWichuraDraws(sampleSize, numberOfDraws, uniformNumbers=unif, antithetic=False)
def normal_halton5(sampleSize, numberOfDraws): unif = draws.getHaltonDraws(sampleSize, numberOfDraws, base=2, skip=10) return draws.getNormalWichuraDraws(sampleSize, numberOfDraws, uniformNumbers=unif, antithetic=False)
def normal_antithetic(sampleSize, numberOfDraws): return draws.getNormalWichuraDraws(sampleSize=sampleSize, numberOfDraws=numberOfDraws, antithetic=True)