def test_adaptive_parzen_normal_orig(): rng = np.random.RandomState(123) prior_mu = 7 prior_sigma = 2 mus = rng.randn(10) + 5 weights2, mus2, sigmas2 = adaptive_parzen_normal_orig( mus, 3.3, prior_mu, prior_sigma) print weights2 print mus2 print sigmas2 assert len(weights2) == len(mus2) == len(sigmas2) == 11 assert np.all(weights2[0] > weights2[1:]) assert mus2[0] == 7 assert np.all(mus2[1:] == mus) assert sigmas2[0] == 2
def test_adaptive_parzen_normal_orig(): rng = np.random.RandomState(123) prior_mu = 7 prior_sigma = 2 mus = rng.randn(10) + 5 weights2, mus2, sigmas2 = adaptive_parzen_normal_orig( mus, 3.3, prior_mu, prior_sigma) print weights2 print mus2 print sigmas2 assert len(weights2) == len(mus2) == len(sigmas2) == 11 assert np.all(weights2[0] > weights2[1:]) assert mus2[0] == 7 assert np.all(mus2[1:] == mus) assert sigmas2[0] == 2
def test_adaptive_parzen_normal_orig(): rng = np.random.default_rng(123) prior_mu = 7 prior_sigma = 2 mus = rng.standard_normal(10) + 5 weights2, mus2, sigmas2 = adaptive_parzen_normal_orig( mus, 3.3, prior_mu, prior_sigma) print(weights2) print(mus2) print(sigmas2) assert len(weights2) == len(mus2) == len(sigmas2) == 11 assert np.all(weights2[0] > weights2[1:]) assert mus2[0] == 7 assert np.all(mus2[1:] == mus) assert sigmas2[0] == 2