Thank you for your detailed response. I subsequently noticed that
sapply(vec,fn)
also fails if the function fn returns an mpfr object. Will the next version of
Rmpfr also fix this usage?
I do enjoy using Rmpfr, and appreciate all that you have done in bringing this
capability to the R comm
The derivative table resides in the function D. In S+ that table is extensible
because it is written in the S language. R is faster but less flexible, since
that table is programmed in C. It would be useful if R provided a mechanism
for extending the derivative table, or barring that, provide
), quote(pi)),
make.call("^", make.call("cospi", expr[[2]]), 2)),
Jerry
From: Avraham Adler [mailto:avraham.ad...@gmail.com]
Sent: Friday, February 17, 2017 4:16 PM
To: Jerry Lewis; r-devel@r-project.org
Subject: Re: [Rd] Wish List: Extensions to the derivatives table
Hi.
Un
Lewis; r-devel@r-project.org
Subject: Re: [Rd] Wish List: Extensions to the derivatives table
On 17/02/2017 1:59 PM, Jerry Lewis wrote:
> The derivative table resides in the function D. In S+ that table is
> extensible because it is written in the S language. R is faster but less
> flexib
Full_Name: Jerry W. Lewis
Version: 2.9.0
OS: Windows XP Professional
Submission from: (NULL) (166.186.168.103)
Quantiles for discrete distributions are consitently implemented, but
inconsitently documented. Help for qpois incorrectly states in the Details
section that
"The quantile is left con
Full_Name: Jerry W. Lewis
Version: 2.9.2
OS: Windows XP Professional
Submission from: (NULL) (96.237.55.233)
trigamma(x) returns 0 for x>1e152, yet
trigamma <- function(x) 1/x
gives machine accuracy for any x>1e16
__
R-devel@r-project.org mailing lis
More generally, the accuracy and working range of psigamma(x,deriv) can be
improved by having it return the leading term of the asymptotic expansion
(-1)^(deriv-1)*factorial(deriv-1)/x^deriv
whenever deriv>=1 and x>=1e15
[[alternative HTML version deleted]]
_
Full_Name: Jerry W. Lewis
Version: 2.10.0
OS: Windows XP Professional
Submission from: (NULL) (96.237.55.233)
pt(0,3,200) # correctly returns 0
pt(-1000,3,200) # erroniously returns 0.003116595
Since pt(0,df,nc) = pnorm(-nc), there is an easily computed upper bound for
pt(-t,df,nc) where t
Full_Name: Jerry W. Lewis
Version: 2.10.0
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)
dchisq is inaccurate in the extreme tails. For instance, dchisq(1510,2,952)
returns 4.871004e-18 which is almost 15 times smaller than the correct value of
7.053889e-17. A better appro
The undefined variables in the original post are
d2 <- df/2-1
sxn <- sqrt(x*ncp)
Jerry
[[alternative HTML version deleted]]
__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Full_Name: Jerry W. Lewis
Version: 2.10.0
OS: XP Professional
Submission from: (NULL) (96.237.55.233)
For a degenerate Poisson distribution (lambda==0), qpois(p,0,lower.tail) should
return 0 for any valid p, but qpois(1,0) and qpois(0,0,F) incorrectly return
Inf.
The issue seems to be that the infinite sum is truncated too early when x
is in the extreme upper tail. An easily validated improvement to to
dnchisq.c would be to add an additional requirement in the upper tail
while condition, that the summation should continue while the additive
term remain
Full_Name: Jerry W. Lewis
Version: 2.10.1
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.21)
In the line
"The quantile is right continuous: qpois(q, lambda) is the smallest integer x
such that P(X <= x) >= q."
"q" is used as a probability when the Arguments section defines it
Full_Name: Jerry W. Lewis
Version: 2.10.1
OS: Windows XP Professional
Submission from: (NULL) (166.186.168.21)
Since
pchisq(x,df,ncp,lower.tail,TRUE)
is calculated as
log(pchisq(x,df,ncp,lower.tail))
it looses accuracy when pchisq(x,df,ncp,lower.tail) is near 1. Accuracy can be
maintained in
Full_Name: Jerry W. Lewis
Version: 2.6.1
OS: Windows XP Professional
Submission from: (NULL) (24.147.191.250)
pchisq(0,0,ncp=lambda) returns 0 instead of exp(-lambda/2)
pchisq(x,0,ncp=lambda) returns NaN instead of exp(-lambda/2)*(1 +
SUM_{r=0}^infty ((lambda/2)^r / r!) pchisq(x, df + 2r))
qchi
Full_Name: Jerry W. Lewis
Version: 2.6.2
OS: Windows XP Professional
Submission from: (NULL) (96.233.108.117)
Currently, beta(a,b) returns NaN if either a or b is negative, but the current
calculation
beta(a,b) = gamma(a)*gamma(b)/gamma(a+b)
works equally well if either or both arguments are n
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(1
Full_Name: Jerry W. Lewis
Version: 2.6.2
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)
choose() returns incorrect values for all fractional arguments, regardless of
sign. It returns 0 when both arguments are negative integers, which is not
always correct (as in some formul
choose(-5,-7) uses integer arguments (as specified in Help) and returns a
numeric value that is incorrect. Either the function or the documentation
should be fixed. If the function is not fixed, a warning or an error
would be helpful.
The fact that choose(n,k) usually returns choose(n,round(
Full_Name: Jerry W. Lewis
Version: 2.6.2
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)
Some methods (sample size calculations, for instance) are based upon calculating
the noncentrality parameter needed to achieve a pre-specified value of the
noncentral cdf. None of the di
Full_Name: Jerry W. Lewis
Version: 2.7.0 (2008-03-23 r44847)
OS: Windows XP Professional
Submission from: (NULL) (71.184.230.48)
choose(n,k) = choose(n,n-k) is not satisfied if either
1. n is a negative integer with k a positive integer (due to automatically
returning 0 for n-k<0)
2. n is not a
Full_Name: Jerry W. Lewis
Version: 2.7.0
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)
The current distribution function naming convention inherited from S (d*, p*,
q*, r* for pdf/pmf, cdf, quantile, & random numbers) is inadequate for
noncentral distributions, where there
Full_Name: Jerry W. Lewis
Version: 2.7.2
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)
Section 1.8 of "An Introduction to R" states "Command lines entered at the
console are limited to about 1024 bytes (not characters)" and indicates that
incomplete lines may be continued o
Full_Name: Jerry W. Lewis
Version: 2.7.0
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)
If you are saying that there is no need to solve for the noncentrality
parameter, please justify this amazing assertion.
If you are saying that this need is already adequately addressed
R implementations of Student's t, chi-squared, F, and beta distributions
all support noncentrality parameters. There is often a need (for example
in sample size problems) to invert the cdf to obtain the noncentrality
parameter given the quantile, instead of to obtain the quantile given the
non
Full_Name: Jerry W. Lewis
Version: 2.8.0
OS: Windows XP Professional
Submission from: (NULL) (71.184.139.210)
On p.1202 of the Reference manual, calculating erf(x) is given as an example
using the code
erf <- function(x) 2 * pnorm(x * sqrt(2)) - 1
A numerically better (avoiding cancellation for
Full_Name: Jerry W. Lewis
Version: 2.8.1
OS: Windows XP Professional
Submission from: (NULL) (198.180.131.16)
It should be the case that
besselI(x,-nu) == besselI(x,nu) == besselI(x,abs(nu))
for integer nu, yet R currently can return ridiculous values when nu is a
negative integer.
For instanc
27 matches
Mail list logo