-
Notifications
You must be signed in to change notification settings - Fork 36
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
bug in my_etruncnorm #78
Comments
I fixed this problem but now there still seems to be a problem with infinite limits:
|
this turned out to be a bug (or feature) of truncnorm::etruncnorm
|
So, for example, |
Is this a recent update on etruncnorm?
…On Fri, Jan 25, 2019 at 11:37 AM Jason Willwerscheid < ***@***.***> wrote:
etruncnorm does not do well when a and/or b are far away from zero, due
to the following lines:
`static R_INLINE double e_truncnorm(double a, double b, double mean,
double sd) {
/* Special case numerically instable case when (a, b) is far away from the
- center of mass. */
if (b < mean - 6.0 * sd || a > mean + 6.0 * sd)
return (a + b) / 2.0;So, for example,truncnorm::etruncnorm(-31.571,
-6.379, 0, 1)gives -18.975 (the correct expected value should be
-6.529). This often leads to problems for semi-nonnegative flash (and, I'd
expect, for any other applications usingunimix`). The weird thing is
that this case shouldn't actually be unstable, given their implementation
(all calculations are done on log scale). We could easily implement the
function ourselves -- it's not complicated. See here, ll. 47-76:
https://github.com/olafmersmann/truncnorm/blob/master/src/truncnorm.c
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#78 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABt4xUCZRsihuo9hQU4-5QlBsXlG5vMjks5vG0DWgaJpZM4Q9spq>
.
|
No, it's been there since 2015. |
there seems to be a bug here:
The text was updated successfully, but these errors were encountered: