binomial distribution test failure

24 views
Skip to first unread message

Bob Carpenter

unread,
Aug 22, 2012, 5:44:29 PM8/22/12
to stan...@googlegroups.com
I don't know how much this matters, but we're now
off in the fourth significant digit, which seems like
a mile:

src/test/prob/distributions/univariate/discrete/binomial_test.cpp:5: Failure
Value of: stan::prob::binomial_log(10,20,0.4)
Actual: -2.140208
Expected: -2.144372
[ FAILED ] ProbDistributionsBinomial.Binomial (0 ms)

The test that fails is:

EXPECT_FLOAT_EQ(-2.144372, stan::prob::binomial_log(10,20,0.4));

I used R to generate the value to test against:

> dbinom(10,20,0.4,log=T)
[1] -2.144372

I just reduced the arithmetic precision on that particular
test to 0.005 and it passes, but just wanted to bring this up in case
it's an issue.

- Bob

Daniel Lee

unread,
Aug 22, 2012, 5:50:34 PM8/22/12
to stan...@googlegroups.com

Looks like beta_binomial() fails too. I haven't looked into it yet, but I guess the error propagates.

--


Matt Hoffman

unread,
Aug 22, 2012, 5:51:03 PM8/22/12
to stan...@googlegroups.com
Still a little disturbing. And almost certainly due to the change I
just pushed. I'll look into it.

Matt
> --
>
>

Matt Hoffman

unread,
Aug 22, 2012, 6:02:10 PM8/22/12
to stan...@googlegroups.com
Fixed it, tests work now. I pushed the wrong cutoff. Stirling's
approximation is much more appropriate for arguments > 1000 than
arguments > 10. Sorry about that.

Matt
Reply all
Reply to author
Forward
0 new messages