similar to: [Fwd: Re: pt inaccurate when x is close to 0 (PR#9945)]

Displaying 20 results from an estimated 900 matches similar to: "[Fwd: Re: pt inaccurate when x is close to 0 (PR#9945)]"

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
2004 Oct 22
3
pgamma discontinuity (PR#7307)
Full_Name: Morten Welinder Version: 2 OS: Solaris/space/gcc2.95.2 Submission from: (NULL) (65.213.85.217) I changed src/nmath/standalone/test.c to read: --------------------------------------------------------------------------------- #define MATHLIB_STANDALONE 1 #include <Rmath.h> #include <stdio.h> int main() { double x; for (x = 99990; x <= 100009; x++) printf
2020 Aug 10
2
qnbinom with small size is slow
Thanks Ben for verifying the issue. It is always reassuring to hear when others can reproduce the problem. I wrote a small patch that fixes the issue (https://github.com/r-devel/r-svn/pull/11): diff --git a/src/nmath/qnbinom.c b/src/nmath/qnbinom.c index b313ce56b2..d2e8d98759 100644 --- a/src/nmath/qnbinom.c +++ b/src/nmath/qnbinom.c @@ -104,6 +104,7 @@ double qnbinom(double p, double size,
2008 Feb 15
1
pt inaccurate when x is close to 0 (PR#9945)
While I agree that the reported results from Mathematica have only 10-13 correct digits, that does not mean that pt() in R is any better for these calculations. For instance the following three calculations are mathematically equivalent, but pt() disagrees at the 13th figure in R v2.6.2 pt(1e-4,13) pf(1e-8,1,13)/2+0.5 pbeta(1/(1+13/1e-8),.5,6.5)/2+0.5 Using 1/(1+n/x^2) and reversing the
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
2002 Feb 28
1
pweibull.c (PR#1334)
Full_Name: M Welinder Version: 1.4 OS: (src) Submission from: (NULL) (192.5.35.38) It seems to me that pweibull can be improved in the lower_tail=TRUE and log_p=FALSE case by using expm1. Something like -expm1(-pow(x / scale, shape)), I think. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read
2005 Nov 07
1
Modifying Internal C Files
Hi All. I want to tweak a few minor things inside of internal C code. I have my Win. XP machine set-up to build packages (including C code), but I'm having problems getting the package to run correctly. In particular, I want to modify a few things inside of pnbeta.c (namely errmax and itrmax), which is what the pbeta() function calls upon when there is a noncentral parameter. I copied the
1999 Mar 10
0
[R] bug? and New bug. --- patch for pt() only (PR#138)
The following patch saves pt(), but not the pf() and pbeta() ones which are harder.. [pbeta(), the incomplete beta ratio is really underlying all these... needs another asymptotic formula, and it's even harder to decide WHEN to switch from the (Taylor kind) series to the asymptotic formula ] This has to wait for a while, unless someone else.... BTW, S-plus also fouls up completely
2004 Apr 15
0
phyper accuracy and efficiency (PR#6772)
Full_Name: Morten Welinder Version: snapshot OS: Submission from: (NULL) (65.213.85.218) Time to kick phyper's tires... The current version has very serious cancellation issues. For example, if you ask for a small right-tail you are likely to get total cancellation. For example phyper(59, 150, 150, 60, FALSE, FALSE) gives 6.372680161e-14. The right answer is dhyper(0, 150, 150, 60,
2002 Oct 25
0
qgamma precision (PR#2214)
Full_Name: Morten Welinder Version: 1.5.1 OS: Solaris Submission from: (NULL) (65.213.85.136) I was having problems with qgamma's precision in the sense that pgamma(qpgamma(x)) was not as close to the identity function as I would like. I was seeing relative errors with random input of about 1e-8. This fits nicely with the code'd EPS2 value of 5e-7. To solve this I added a newton step
2002 Feb 28
4
pexp.c (PR#1335)
Full_Name: M Welinder Version: 1.4 OS: (src) Submission from: (NULL) (192.5.35.38) It seems to me that pexp can be improved in the lower_tail=TRUE and log_p=FALSE case by using expm1. Something like -expm1 (-x / scale); I think. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send
2007 Oct 10
2
pt inaccurate when x is close to 0 (PR#9945)
Full_Name: Skylab Gupta Version: R version 2.5.1 (2007-06-27) OS: Windows XP Submission from: (NULL) (216.82.144.137) Hello, I have been playing around with the statistical distributions in R. I think the computations for the cumulative distribution function of the students t distribution in R are not very accurate. For instance, the cdf of a students t distribution with 13 degrees of freedom
2004 Mar 24
1
R_DT_val accuracy (PR#6692)
Full_Name: M. Welinder Version: 1.8.1 OS: Solaris Submission from: (NULL) (65.213.85.227) Currently R has... #define R_D_Lval(p) (lower_tail ? (p) : (1 - (p))) /* p */ #define R_D_val(x) (log_p ? log(x) : (x)) /* x in pF(x,..) */ #define R_DT_val(x) R_D_val(R_D_Lval(x)) /* x in pF */ ...which is sub-optimal in the lower_tail==FALSE && log_p==TRUE case. Something like this ought
2020 Aug 20
0
qnbinom with small size is slow
>>>>> Constantin Ahlmann-Eltze via R-devel >>>>> on Mon, 10 Aug 2020 10:05:36 +0200 writes: > Thanks Ben for verifying the issue. It is always reassuring to hear > when others can reproduce the problem. > I wrote a small patch that fixes the issue > (https://github.com/r-devel/r-svn/pull/11): > diff --git
2004 Jan 15
1
Exactness of ppois
Hello, by checking the precision of a convolution algorithm, we found the following "inexactness": We work with R Version 1.8.1 (2003-11-21) on Windows systems (NT, 2000, XP). Try the code: ## Kolmogorov distance between two methods to ## determine P(Poisson(lambda)<=x) Kolm.dist <- function(lam, eps){ x <- seq(0,qpois(1-eps, lambda=lam), by=1) max(abs(ppois(x,
2006 Jan 28
1
PR#8528
On 23/02/05 I suggested that given R had included TOMS 708 to correct for t= he=20 poor performance of pbeta, TOMS 654 should be included to fix all the pgamm= a=20 problems. I was slightly surprised to find Morten's code had been included= =20 instead 2 days later. I noticed but did not worry that the reference to me = had=20 been removed.=20 The derivation of the asymptotic expansion for
2020 Aug 21
1
qnbinom with small size is slow
Hi Martin, thanks for verifying. I agree that the Cornish-Fisher seems to struggle with the small size parameters, but I also don't have a good idea how to replace it. But I think fixing do_search() is possible: I think the problem is that when searching to the left y is decremented only if `pnbinom(y - incr, n, pr, /*l._t.*/TRUE, /*log_p*/FALSE)) < p` is FALSE. I think the solution is
2004 Apr 11
3
pcauchy precision (PR#6756)
Full_Name: Morten Welinder Version: snapshot OS: Submission from: (NULL) (65.213.85.129) Two things are wrong. 1. There is nan test outside IEEE_754. 2. The meat part of the function should really be something like... if (!lower_tail) x = -x; if (fabs (x) > 1) { double temp = atan (1 / x) / M_PI; return (x > 0) ? R_D_Clog (temp) : R_D_val (-temp); } else
2001 Mar 10
0
Re: [R] Bug in qchisq? (PR#875)
Kenneth Cabrera <krcabrer@epm.net.co> writes: > Hello developers and users: > > My system fails (the computer freezes) when I use the ncp parameter, > with the lower.tail=FALSE option in the qchisq function. > > qchisq(0.025,31,ncp=1,lower.tail=FALSE) Yup, that's a bug. We have in pnchisq.c 48 for (ux = 1.0; pnchisq(ux, n, lambda, lower_tail, log_p) <
2001 Mar 13
0
Re: [R] Bug in qchisq? (PR#875)
>>>>> "PD" == p dalgaard <p.dalgaard@biostat.ku.dk> writes: PD> Kenneth Cabrera <krcabrer@epm.net.co> writes: >> Hello developers and users: >> >> My system fails (the computer freezes) when I use the ncp parameter, >> with the lower.tail=FALSE option in the qchisq function. >> >>