I have committed a fix for r-devel (dnorm only).
-pd
> On 9 Dec 2019, at 08:49 , Martin Maechler wrote:
>
>> peter dalgaard
>>on Sun, 8 Dec 2019 12:11:50 +0100 writes:
>
>> Yes, that looks like a bug and an easily fixable one too.
>
> agreed.
>
>> However, I spy another issue:
> peter dalgaard
> on Sun, 8 Dec 2019 12:11:50 +0100 writes:
> Yes, that looks like a bug and an easily fixable one too.
agreed.
> However, I spy another issue: Why do we check the
> !R_FINITE(x) && mu == x before checking for sd < 0 ? The
> difference is whether we
Yes, that looks like a bug and an easily fixable one too.
However, I spy another issue: Why do we check the !R_FINITE(x) && mu == x
before checking for sd < 0 ? The difference is whether we
return ML_NAN;
or
ML_ERR_return_NAN;
but surely negative sd should always be an error?
I'd be inclined
Good question, I cannot speak for R's developers but I would like to
provide some information on the problem. Here are the first few lines of
the dnorm function located at src\nmath\dnorm.c:
```
double dnorm4(double x, double mu, double sigma, int give_log)
{
#ifdef IEEE_754
if (ISNAN(x) ||
Hi,
Apropos of a recent Inf question, I've previously wondered if dnorm "does the
right thing" with
dnorm(0, 0, -Inf)
which gives zero. Should that be zero or NaN (or NA)?
The help says "'sd < 0' is an error and returns 'NaN'" and since -Inf < 0 is
TRUE, then... is this a bug?
Thank you,