Skip to content
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

Truncated normal variance #276

Closed
wants to merge 3 commits into from
Closed

Truncated normal variance #276

wants to merge 3 commits into from

Conversation

LaurenceA
Copy link

Fixes Issue #264. There are three changes, all of which help us to compute the moments of a truncated Gaussian.
First, there was a bug in the implementation of the variance for Truncated Normal moments.
Second, the moment calculations often fail because the normalizing constant has a large error. This has been fixed by making sure that we use ccdf if cdf(d, u) and cdf(d, l) are close to 1.
Third, tests have been added, one of which fails if the second alteration is not made.

Truncated{typeof(d),S}(d,l,u, cdf(d, u) - cdf(d, l))
cdf_u = cdf(d, u)
cdf_l = cdf(d, l)
nc = if cdf_u > 0.98 && cdf_l > 0.98
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do anything to calibrate these magic numbers? They seem sensible, but I wonder if we might want to test them.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not clear: they really tradeoff computation time against accuracy (because if the test passes then you've got to do more work). Some people will care more about speed, others will care more about accuracy.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 65263ec on LaurenceA:truncated-moments into * on JuliaStats:master*.

@cossio
Copy link
Contributor

cossio commented Dec 6, 2017

This should be closed? Superseded by #292, #295

@andreasnoack
Copy link
Member

Yes. Seem right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants