hakaru-dev / hakaru

A probabilistic programming language
BSD 3-Clause "New" or "Revised" License
311 stars 30 forks source link

Erlang test2 #157

Closed sohraa3 closed 6 years ago

sohraa3 commented 6 years ago

This branch includes additions that would be used to test the second relationship here: https://en.wikipedia.org/wiki/Erlang_distribution#Related_distributions

The files tests/RoundTrip/t_erlang_to_erlang_1.0.hk and tests/RoundTrip/t_erlang_to_erlang_1.expected.hk are the test and expected respectively.

The output of this test was the following:

Failure in: 6:RoundTrip:6:0:t_erlang_to_erlang_2:1

haskell/Tests/TestTools.hs:130
expected:
fn shape1 nat:
fn shape2 nat:
fn scale prob: gamma(nat2prob(shape1) + nat2prob(shape2), scale)
but got:
fn shape1 nat:
fn shape2 nat:
fn scale prob:
Xb <~ gamma(nat2prob(shape1), scale)
Y9 <~ gamma(nat2prob(shape2), scale)
return Xb + Y9