hakaru-dev / hakaru

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

Fixed Rayleigh Tests #197

Open mkhattab940 opened 6 years ago

mkhattab940 commented 6 years ago

Fixed up Rayleigh tests so that they no longer fail the 0-test. Also fixed up RoundTrip so it only has 1 set of Rayleigh tests.

Weibull to Rayleigh test now passes. Here is what the other test failures look like now:

### Failure in: 0:RoundTrip:0:0:t_exponential_to_rayleigh:1
haskell/Tests/TestTools.hs:130
expected:
X3 <~ uniform(+0/1, +1/1)
return sqrt(real2prob(log(real2prob(X3)) * (-1/1)))
but got:
X3 <~ gamma(1/1, 1/1)
return sqrt(X3)
Cases: 6  Tried: 2  Errors: 0  Failures: 1
Cases: 6  Tried: 3  Errors: 0  Failures: 1

### Failure in: 0:RoundTrip:0:1:t_rayleigh_to_gamma:1
haskell/Tests/TestTools.hs:130
expected:
gamma(1/1, 2/1)
but got:
X3 <~ uniform(+0/1, +1/1)
return real2prob(log(real2prob(X3)) * (-1/1))
Cases: 6  Tried: 4  Errors: 0  Failures: 2
Cases: 6  Tried: 5  Errors: 0  Failures: 2