Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mixture random sampling for multidimensional sizes #2249

Closed
wants to merge 1 commit into from
Closed

Fix mixture random sampling for multidimensional sizes #2249

wants to merge 1 commit into from

Conversation

AustinRochford
Copy link
Member

@twiecki
Copy link
Member

twiecki commented May 31, 2017

_________________ TestMatchesScipy.test_zeroinflatedbinomial __________________
self = <pymc3.tests.test_distributions.TestMatchesScipy object at 0x7fa0117fd690>
    def test_zeroinflatedbinomial(self):
        self.checkd(ZeroInflatedBinomial, Nat,
>                   {'psi': Unit, 'n': NatSmall, 'p': Unit})
pymc3/tests/test_distributions.py:596: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
pymc3/tests/test_distributions.py:415: in checkd
    check(m, m.named_vars['value'], valuedomain, vardomains)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <pymc3.tests.test_distributions.TestMatchesScipy object at 0x7fa0117fd690>
model = <pymc3.model.Model object at 0x7fa0117fdfd0>, value = value
domain = <pymc3.tests.test_distributions.Domain object at 0x7fa09803a450>
paramdomains = {'n': <pymc3.tests.test_distributions.Domain object at 0x7fa09803a5d0>, 'p': <pymc3.tests.test_distributions.Domain object at 0x7fa09803a250>, 'psi': <pymc3.tests.test_distributions.Domain object at 0x7fa09803a250>}
    def check_int_to_1(self, model, value, domain, paramdomains):
        pdf = model.fastfn(exp(model.logpt))
        for pt in product(paramdomains, n_samples=100):
            pt = Point(pt, value=value.tag.test_value, model=model)
            bij = DictToVarBijection(value, (), pt)
            pdfx = bij.mapf(pdf)
            area = integrate_nd(pdfx, domain, value.dshape, value.dtype)
>           assert_almost_equal(area, 1, err_msg=str(pt))
E           AssertionError: 
E           Arrays are not almost equal to 7 decimals
E           {'p': array(0.001), 'psi': array(0.001), 'value': array(0), 'n': array(3)}
E            ACTUAL: nan
E            DESIRED: 1
pymc3/tests/test_distributions.py:380: AssertionError

@twiecki
Copy link
Member

twiecki commented Dec 22, 2018

Closing because of age. Feel free to reopen if you want to fix this up.

@twiecki twiecki closed this Dec 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants