Skip to content

Commit 5d2677e

Browse files
author
maechler
committed
pgamma() & pchisq() are not always "cadlag": fix docu thanks to Robert Schlicht`s PR#18888
git-svn-id: https://svn.r-project.org/R/trunk@88402 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent f3f1b40 commit 5d2677e

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/library/stats/man/Chisquare.Rd

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/stats/man/Chisquare.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 1995-2019 R Core Team
3+
% Copyright 1995-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{Chisquare}
@@ -31,7 +31,10 @@ rchisq(n, df, ncp = 0)
3131
\item{ncp}{non-centrality parameter (non-negative).}
3232
\item{log, log.p}{logical; if TRUE, probabilities p are given as log(p).}
3333
\item{lower.tail}{logical; if TRUE (default), probabilities are
34-
\eqn{P[X \le x]}, otherwise, \eqn{P[X > x]}.}
34+
\eqn{P[X \le x]}, otherwise, \eqn{P[X > x]}, unless for \code{df=0} and
35+
when \code{ncp} is missing, where the central chi-square cdf is based
36+
on \code{\link{pgamma}()}; in this case, probabilities are
37+
\eqn{P[X < x]} when \code{lower.tail} is true, and \eqn{P[X \ge x]}, otherwise.}
3538
}
3639
\value{
3740
\code{dchisq} gives the density, \code{pchisq} gives the distribution

src/library/stats/man/GammaDist.Rd

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/stats/man/GammaDist.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 1995-2020 R Core Team
3+
% Copyright 1995-2025 R Core Team
44
% Distributed under GPL 2 or later
55

66
\name{GammaDist}
@@ -35,7 +35,8 @@ rgamma(n, shape, rate = 1, scale = 1/rate)
3535
\item{log, log.p}{logical; if \code{TRUE}, probabilities/densities \eqn{p}
3636
are returned as \eqn{log(p)}.}
3737
\item{lower.tail}{logical; if TRUE (default), probabilities are
38-
\eqn{P[X \le x]}, otherwise, \eqn{P[X > x]}.}
38+
\eqn{P[X < x]}, otherwise, \eqn{P[X \ge x]} (exceptionally not
39+
\emph{cadlag} here, to ensure, e.g., \code{pgamma(0, shape=0)} remains zero).}
3940
}
4041
\value{
4142
\code{dgamma} gives the density,
@@ -76,7 +77,7 @@ rgamma(n, shape, rate = 1, scale = 1/rate)
7677
}
7778
7879
Note that for smallish values of \code{shape} (and moderate
79-
\code{scale}) a large parts of the mass of the Gamma distribution is
80+
\code{scale}) a large part of the mass of the Gamma distribution is
8081
on values of \eqn{x} so near zero that they will be represented as
8182
zero in computer arithmetic. So \code{rgamma} may well return values
8283
which will be represented as zero. (This will also happen for very

0 commit comments

Comments
 (0)