Open
Conversation
Contributor
|
Done in-lining. Test now fails like this: |
Contributor
|
Hmmm, why does your expected have an 'abs' but the result doesn't? That is very puzzling. |
Contributor
|
I've looked at the question you ask (i.e. what the test is) -- it is your 'expected' which is wrong. What you 'got' is correct. |
JacquesCarette
requested changes
Apr 24, 2018
Contributor
JacquesCarette
left a comment
There was a problem hiding this comment.
Fix the expected to be correct.
Contributor
|
Ok fixed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Failure in: 6:RoundTrip:7:0:t_cauchy_to_students_t:0
haskell/Tests/TestTools.hs:130
expected:
chiSq_iid = fn n nat:
fn mean real:
fn stdev prob:
q <~ plate _ of n: normal(mean, stdev)
return summate i from 0 to size(q):
((q[i] - mean) * prob2real(1/ stdev)) ^ 2
standardChiSq = fn n nat: chiSq_iid(n, nat2real(0), nat2prob(1))
standardChi = fn n nat:
q <~ standardChiSq(n)
return sqrt(real2prob(q))
nonCentralT = fn n nat:
fn delta prob:
U <~ normal(nat2real(0), nat2prob(1))
X <~ standardChi(n)
return (U + prob2real(delta))
* prob2real(sqrt(nat2prob(n)))
* prob2real(1/ X)
t = fn n nat: nonCentralT(n, nat2prob(0))
t(1)
but got:
U7 <~ normal(+0/1, 1/1)
q305 <~ normal(+0/1, 1/1)
return U7 * prob2real(1/ abs(q305))
Cases: 342 Tried: 293 Errors: 2 Failures: 25
Failure in: 6:RoundTrip:7:0:t_cauchy_to_students_t:1
haskell/Tests/TestTools.hs:130
expected:
chiSq_iid = fn n nat:
fn mean real:
fn stdev prob:
q <~ plate _ of n: normal(mean, stdev)
return summate i from 0 to size(q):
((q[i] - mean) * prob2real(1/ stdev)) ^ 2
standardChiSq = fn n nat: chiSq_iid(n, nat2real(0), nat2prob(1))
standardChi = fn n nat:
q <~ standardChiSq(n)
return sqrt(real2prob(q))
nonCentralT = fn n nat:
fn delta prob:
U <~ normal(nat2real(0), nat2prob(1))
X <~ standardChi(n)
return (U + prob2real(delta))
* prob2real(sqrt(nat2prob(n)))
* prob2real(1/ X)
t = fn n nat: nonCentralT(n, nat2prob(0))
t(1)
but got:
p5 <~ normal(+0/1, 1/1)
p3 <~ normal(+0/1, 1/1)
return p5 / p3
Cases: 342 Tried: 294 Errors: 2 Failures: 26