similar to: What should dnorm(0, 0, -Inf) return?

Displaying 20 results from an estimated 1000 matches similar to: "What should dnorm(0, 0, -Inf) return?"

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;
2019 Dec 09
0
What should dnorm(0, 0, -Inf) return?
>>>>> 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 > return ML_NAN; or ML_ERR_return_NAN;
2019 Dec 07
0
What should dnorm(0, 0, -Inf) return?
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) || ISNAN(mu) || ISNAN(sigma)) return x + mu + sigma; #endif if(!R_FINITE(sigma)) return R_D__0;
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
2005 Apr 02
2
Solaris10/amd64 + SunSutio Compile (PR#7767)
Full_Name: Teru KAMOGASHRIA Version: 2.0.1 OS: SunOS sun 5.10 Generic i86pc i386 i86pc Submission from: (NULL) (219.5.176.24) rbinom.c cannot be compiled because of the casting problem. /opt/SUNWspro/bin/cc -I. -I../../src/include -I../../src/include -I/usr/local/include -DHAVE_CONFIG_H -D__NO_MATH_INLINES -g -c rbinom.c -o rbinom.o "rbinom.c", line 60: operand must have real
2001 Feb 08
2
dnbinom(,size<1,)=0 (PR#842)
This came up on r-help but indicates a bug. dnbinom(x,n,p) calls dbinom_raw(n-1,...) which returns 0 for n<1. -thomas ---------- Forwarded message ---------- Date: Thu, 08 Feb 2001 17:10:23 +0000 From: Yudi Pawitan <yudi@stat.ucc.ie> To: Mark Myatt <mark@myatt.demon.co.uk> Cc: R-Help <r-help@stat.math.ethz.ch> Subject: Re: [R] Goodness of fit to Poisson / NegBinomial
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
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
2002 Oct 21
1
dist() {"mva" package} bug: treats +/- Inf as NA
Vince Carey found this (thank you!). Since the fix to the problem is not entirely obvious, I post this to R-devel as RFC: help(dist) says: >> Missing values are allowed, and are excluded from all computations >> involving the rows within which they occur. If some columns are >> excluded in calculating a Euclidean, Manhattan or Canberra >> distance, the sum is
1999 Sep 13
5
axis() produces junk on DEC alpha (PR#274)
Full_Name: Albrecht Gebhardt Version: 0.65.0 OS: Digital Unix 4.0E Submission from: (NULL) (212.17.104.62) Plottimg on the Alpha stopped working with 0.65.0. The tickmarks have a length of -Inf and go across the whole plot. A first solution is the following patch: --- src/main/plot.c.alpha-patch Mon Sep 13 01:37:11 1999 +++ src/main/plot.c Mon Sep 13 01:58:16 1999 @@ -832,7 +832,7 @@
2005 Jan 04
2
ISNAN() broken? in ver 2.x on MacOS X
I have a problem building an extension using ISNAN() on R version 2.0.x. In R 1.9.1 Arith.h and Rmath.h contained code like #ifdef IEEE_754 # define ISNAN(x) (isnan(x)!=0) #else # define ISNAN(x) R_IsNaNorNA(x) #endif #define R_FINITE(x) R_finite(x) int R_IsNaNorNA(double); int R_finite(double); which works. R 2.0.x has # define ISNAN(x) (isnan(x)!=0) unconditionally. This breaks
2005 Jan 04
2
ISNAN() broken? in ver 2.x on MacOS X
I have a problem building an extension using ISNAN() on R version 2.0.x. In R 1.9.1 Arith.h and Rmath.h contained code like #ifdef IEEE_754 # define ISNAN(x) (isnan(x)!=0) #else # define ISNAN(x) R_IsNaNorNA(x) #endif #define R_FINITE(x) R_finite(x) int R_IsNaNorNA(double); int R_finite(double); which works. R 2.0.x has # define ISNAN(x) (isnan(x)!=0) unconditionally. This breaks
2003 Jul 16
2
Density function for non-central t distribution
Hi, I've written some C code for density evaluation of the non-central t distribution. It works with the R-1.7.1 source code if placed in the src/nmath directory and after appropriate changes are made to Makefiles, to the dt function in src/library/base/R/distn.R etc. I haven't read a lot of R source code so it may need some R-ification, but I've tried to use the dt.c file as a
2010 Jan 22
2
Optimizing C code
Hi the list, I need to write some efficient distances function, so I read the code for the Euclidean distance. I do not understand the purpose of the line 11 : if x[i] and y[i] are not NA (line 9), can dev be NA ? Christophe #define both_FINITE(a,b) (R_FINITE(a) && R_FINITE(b)) #define both_non_NA(a,b) (!ISNAN(a) && !ISNAN(b)) 1. static double R_euclidean2(double *x, double
2000 Feb 25
1
lambda==0 in dpois() (PR#459)
The nice new log=TRUE option in dpois appears to mess up the case where lambda=0 (I was trying to calculate the likelihood of a saturated model). Because the behavior is now always to calculate the probability in terms of exp(log(prob)), there's a test for lambda<=0 which really needs to be only lambda<0. dpois(0:5,0) ought to give 1 0 0 0 0 but gives NaNs instead. Here's
2005 Aug 09
0
qpois minor bug (PR#8058)
Full_Name: Mikael Weigelt Version: 2.0 OS: windows Submission from: (NULL) (207.171.180.101) The calculation of the qpois attempts to use the Cornish-Fisher expansion as a starting approximation. The definition of the expansion is incorrect. However, since this approximation just gives an initial solution, the end result of the function is still correct. To fix the approximation, in the
2016 Jul 01
1
Calling C implementations of rnorm and friends
Well, For this particular use case why not just transform the parameters at the R level and then call the existing function? Is there not a closed form mapping? ~G On Jul 1, 2016 2:50 PM, "Joshua Ulrich" <josh.m.ulrich at gmail.com> wrote: > On Fri, Jul 1, 2016 at 6:13 AM, Luis Usier > <luis.henrique.usier at gmail.com> wrote: > > Gabriel, > > > >
2005 May 27
1
qcauchy accuracy (PR#7902)
Full_Name: Morten Welinder Version: 2.1.0 OS: src only Submission from: (NULL) (216.223.241.212) Now that pcauchy has been fixed, it is becoming clear that qcauchy suffers from the same problems. qcauchy(pcauchy(1e100,0,1,FALSE,TRUE),0,1,FALSE,TRUE) should yield 1e100 back, but I get 1.633178e+16. The code below does much better. Notes: 1. p need not be finite. -Inf is ok in the log_p
2017 Feb 09
3
Ancient C /Fortran code linpack error
In my package 'glmmML' I'm using old C code and linpack in the optimizing procedure. Specifically, one part of the code looks like this: F77_CALL(dpoco)(*hessian, &bdim, &bdim, &rcond, work, info); if (*info == 0){ F77_CALL(dpodi)(*hessian, &bdim, &bdim, det, &job); ........ This usually works OK, but with an ill-conditioned data
2009 Jul 14
1
Incorrect comment about ISNA(x) in Arith.h (PR#13826)
R-2.9.0/include/R_ext/Arith.h has: int R_IsNA(double); /* True for R's NA only */ int R_IsNaN(double); /* True for special NaN, *not* for NA */ int R_finite(double); /* True if none of NA, NaN, +/-Inf */ #define ISNA(x) R_IsNA(x) /* True for *both* NA and NaN. The first and last lines are contradictory - if R_IsNA is true only for NA, not NaN, then ISNA should be the same.