hakaru-dev / hakaru

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

Cauchy Tests fix up #198

Open mkhattab940 opened 6 years ago

mkhattab940 commented 6 years ago

Fixed up Cauchy tests that have already been merged. Inlined them. Here is their failure now:

### Failure in: 0:RoundTrip:0:0:t_cauchy_add_transformation:1
haskell/Tests/TestTools.hs:130
expected:
X1 <~ normal(+0/1, 1/1)
X2 <~ normal(+0/1, 1/1)
return (X2 * (+2/1) + X1 * (+3/1)) / X2 * (+2/1)
but got:
pb <~ normal(+0/1, 1/1)
p9 <~ normal(+0/1, 1/1)
p7 <~ normal(+0/1, 1/1)
p5 <~ normal(+0/1, 1/1)
return (p5 * p9 * (+2/1) + p5 * pb + p7 * p9 * (+2/1))
       / p9
       / p5
       * (+2/1)
Cases: 4  Tried: 2  Errors: 0  Failures: 1
Cases: 4  Tried: 3  Errors: 0  Failures: 1

### Failure in: 0:RoundTrip:0:1:t_cauchy_sub_transformation:1
haskell/Tests/TestTools.hs:130
expected:
X1 <~ normal(+0/1, 1/1)
X2 <~ normal(+0/1, 1/1)
return (X2 * (-1/1) + X1 * (+3/1)) / X2 * (+2/1)
but got:
pb <~ normal(+0/1, 1/1)
p9 <~ normal(+0/1, 1/1)
p7 <~ normal(+0/1, 1/1)
p5 <~ normal(+0/1, 1/1)
return (p5 * p9 + p5 * pb * (-1/1) + p7 * p9 * (+2/1))
       / p9
       / p5
       * (-2/1)
Cases: 4  Tried: 4  Errors: 0  Failures: 2