In the predecessor of this package (hse
versions 0.1-15
and earlier), the probability function of the distribution
was calculated as dbeta(x/(ntop+1),alpha,beta)/
sum(dbeta((nbot:ntop)/(ntop+k),alpha,beta))
where nbot
and k
were set to 1 if zeta
was FALSE
,
and nbot
was set to 0 and k
to 2 if zeta
was TRUE
.
However the probability function is calculated in a more
“direct” manner, using an exponential family representation
of this function. The Beta
distribution is no longer called
upon (although it still of course conceptually underlies the
distribution).
The function ddb()
is a probability mass function for
an ad hoc finite discrete distribution of ordered values,
with a “reasonably flexible” shape.
The \(p\)th quantile of a random variable \(X\) is defined to be
the infimum over the range of \(X\) of those values of \(x\)
such that \(F(x) \geq p\) where \(F(x)\) is the cumulative
distribution function for \(X\). Note that if we did not impose the
“over the range of \(X\)” restriction, then the 0th quantile of
e.g. an exponential distribution would be \(-\infty\)
(since \(F(x) \geq 0\) for all \(x\)) whereas we
actually want this quantile to be 0.
Consequently qdb(p,alpha,beta,ntop)
is equal to the
least value of i
such that pdb(i,alpha,beta,ntop)
\(\geq\) p
. The set of values of i
to be
considered is {1,2,...,ntop}
if zeta
is
FALSE
and is {0,1,2,...,ntop}
if zeta
is TRUE
.