Displaying 10 results from an estimated 10 matches for "ml_nan".
Did you mean:
is_nan
2019 Dec 08
2
What should dnorm(0, 0, -Inf) return?
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 to do
if (sigma < 0) ML_ERR_return_NAN;
if(!R_FINITE(sigma)) return R_D__0;
if(!R_FINITE(x) && mu == x) return ML_NAN;/* x-mu is NaN */
if (sigma == 0)
return (x == mu...
2019 Dec 07
2
What should dnorm(0, 0, -Inf) return?
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,
Stephen
Rochester, MN USA
2019 Dec 09
0
What should dnorm(0, 0, -Inf) return?
...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
> return ML_NAN; or ML_ERR_return_NAN;
> but surely negative sd should always be an error?
> I'd be inclined to do
> if (sigma < 0) ML_ERR_return_NAN;
> if(!R_FINITE(sigma)) return R_D__0;
> if(!R_FINITE(x) && mu == x) return ML_NAN;/* x-mu is NaN */
> if...
2005 Apr 07
0
R 2.1.0 (beta) on IRIX
...INE keyword. I can't see
another solution, and reading these guidelines on inlining
( http://www.greenend.org.uk/rjk/2003/03/inline.html ) leaves me no
wiser.
2) IEEE arithmetic
The standalone math library fails to compile, as the compiler chokes on
the definition of ML_POSINF, ML_NEGINF and ML_NAN, e.g.
> cc-1195 cc: ERROR File = mlutils.c, Line = 130
> The indicated floating-point operation result is out of range.
>
> double NA_REAL = ML_NAN;
where ML_NAN is defined as (0.0 / 0.0) in nmath.h. The compiler flag
-OPT:IEEE_NaN_inf=ON is supposed to enforce IEEE arithmetic...
2000 Jun 16
2
R and OpenBSD
Howdy!
Has anybody successfully installed R under OpenBSD? I just tried to
install the latest R-release under OpenBSD 2.7 and got the following
errors in the make step:
pnorm.c:62 'ML_ERR_return_NAN' undeclared
pnorm.c:62 'ML_NAN' undeclared
pnorm.c:62 'ML_NEGINF' undeclared
--Ragnar
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in t...
2000 Jun 16
2
R and OpenBSD
Howdy!
Has anybody successfully installed R under OpenBSD? I just tried to
install the latest R-release under OpenBSD 2.7 and got the following
errors in the make step:
pnorm.c:62 'ML_ERR_return_NAN' undeclared
pnorm.c:62 'ML_NAN' undeclared
pnorm.c:62 'ML_NEGINF' undeclared
--Ragnar
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in t...
2005 Dec 14
1
R-beta on AIX5.2
...h.h", line 50.9: 1506-358 (I) "calloc" is defined on line 641 of
/usr/include/stdlib.h.
make[3]: *** [mlutils.o] Error 1
--- R-beta.orig/src/nmath/nmath.h 2005-10-06 19:25:25.000000000 +0900
+++ R-beta/src/nmath/nmath.h 2005-12-13 19:33:59.000000000 +0900
@@ -47,6 +47,7 @@
#define ML_NAN R_NaN
void R_CheckUserInterrupt(void);
+#undef calloc
#define calloc R_chk_calloc
#define free R_chk_free
--
http://www.nakama.ne.jp, http://r.nakama.ne.jp
e-mail : EIJI Nakama <nakama at ki.rim.or.jp>
2009 Dec 15
3
RFC: lchoose() vs lfactorial() etc
lgamma(x) and lfactorial(x) are defined to return
ln|Gamma(x)| {= log(abs(gamma(x)))} or ln|Gamma(x+1)| respectively.
Unfortunately, we haven't chosen the analogous definition for
lchoose().
So, currently
> lchoose(1/2, 1:10)
[1] -0.6931472 -2.0794415 NaN -3.2425924 NaN -3.8869494
[7] NaN -4.3357508 NaN -4.6805913
Warning message:
In
2019 Dec 07
0
What should dnorm(0, 0, -Inf) return?
...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) || ISNAN(mu) || ISNAN(sigma))
return x + mu + sigma;
#endif
if(!R_FINITE(sigma)) return R_D__0;
if(!R_FINITE(x) && mu == x) return ML_NAN;/* x-mu is NaN */
if (sigma <= 0) {
if (sigma < 0) ML_ERR_return_NAN;
/* sigma == 0 */
return (x == mu) ? ML_POSINF : R_D__0;
}
....
}
```
You can clearly see where the problem is. I think either the document or
the code needs a modification.
Best,
Jiefei
On...
2016 Dec 01
1
Different results for cos,sin,tan and cospi,sinpi,tanpi
hi,
my environment...
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)
locale:
[1] LC_CTYPE=ja_JP.UTF-8 LC_NUMERIC=C
[3] LC_TIME=ja_JP.UTF-8 LC_COLLATE=ja_JP.UTF-8
[5] LC_MONETARY=ja_JP.UTF-8 LC_MESSAGES=ja_JP.UTF-8
[7] LC_PAPER=ja_JP.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C