def _probability_component_continuous(x, model, col_idx, component_idx): hypers = model['col_hypers'][col_idx] if component_idx < len(model['col_suffstats'][col_idx]): suffstats = model['col_suffstats'][col_idx][component_idx] else: suffstats = {'n': 0., 'sum_x': 0., 'sum_x_sq': 0.} return nng.probability(x, suffstats, hypers)
def test_probability_values_2(suffstats, hypers): log_nng_pp = nng.probability(-3, suffstats, hypers) assert log_nng_pp == approx(-6.1637698862186)
def test_probability_values_1(suffstats, hypers): log_nng_pp = nng.probability(3, suffstats, hypers) assert log_nng_pp == approx(-1.28438638499611)