Description Usage Arguments Details
Density (dtvgeom_nimble
), distribution function
(qtvgeom_nimble
), quantile function (ptvgeom_nimble
),
and random number generation (rtvgeom_nimble
for the time-varying,
right-truncated geometric distribution with parameter prob
. This
distribution is identical to the one in the tvgeom package, but functions
are implemented as nimbleFunctions, which allows them to be compiled to C++.
For general use of the tvgeom distribution, it is recommended that you use
the functions provided in the tvgeom package.
1 2 3 4 5 6 7 | dtvgeom_nimble(x, prob, log = 0)
ptvgeom_nimble(q, prob, lower.tail = 1, log.p = 0)
qtvgeom_nimble(p, prob, lower.tail = 1, log.p = 0)
rtvgeom_nimble(n, prob)
|
x, q |
vector of quantiles representing the trial at which the first success occurred. |
prob |
vector of the probability of success for each trial. |
log, log.p |
logical; if |
lower.tail |
logical; if |
p |
vector of probabilities at which to evaluate the quantile function. |
n |
number of observations to sample. For *tvgeom_nimble functions, must be 1. |
The time-varying geometric distribution describes the number of independent
Bernoulli trials needed to obtain one success. The probability of success,
prob
, may vary for each trial. It has mass
p(x) = prob[x] * prod(1 - prob[1:(x-1)])
with support x = 1, 2, ..., n. For i in prob, 0 ≤ i ≤ 1.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.