ddiscrete(x, prob = NULL, values = seq(along = prob), log = FALSE) pdiscrete(q, prob = NULL, values = seq(along = prob), lower.tail = TRUE, log.p = FALSE) qdiscrete(p, prob = NULL, values = seq(along = prob), lower.tail = TRUE, log.p = FALSE) rdiscrete(n, prob = NULL, values = seq(along = prob))
NA
s) are allowed.
NA
s) are allowed.
NA
s) are allowed.
values
, containing probabilities
to define a distribution with unequal probabilities.
These are normalized to sum to 1.
NULL
indicates equal probabilities.
TRUE
, probabilities
p
are given as
log(p)
.
TRUE
(default), probabilities are P[X <= x],
otherwise, P[X > x].
ddiscrete
), probability (
pdiscrete
),
quantile (
qdiscrete
) or random sample (
rdiscrete
)
for a discrete distribution with probability given by
prob
with support at
values
.
prob
.
Elements of
x
,
q
or
p
that are missing cause the
corresponding elements of the result to be missing.
The quantile is defined as the smallest value q such that
Pr(random variate <= q) >= p
.
Other definitions are more appropriate if
values
is a set
of random data; see
.
pdiscrete
, but gives counts rather than proportions
of the number of
values
that are <= each of the quantiles.
,
,
.
x <- c(1,3,5) z <- 0:6 pdiscrete(z, values = x) countLessThan(x, z) pdiscrete(z, values = x, prob=c(.5,.2,.1)) # are normalized rdiscrete(5, values = x)