-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cauchy test 4 #191
base: master
Are you sure you want to change the base?
Cauchy test 4 #191
Conversation
Done in-lining. Test now fails like this:
|
Hmmm, why does your expected have an 'abs' but the result doesn't? That is very puzzling. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the expected to be correct.
Ok fixed |
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