Repository navigation
v2.0.17
-
llikNbinom()andllikNbinomMu()now accept a continuous (non-integer)
size. In the negative binomial's mean/dispersion parameterisationsize
is a real dispersion parameter, not a count, andstats::dnbinom()has
always allowed it. Previouslysizewas stored in an integer vector and
silently truncated, so asizeabove 1 returned the log-likelihood at
trunc(size)and asizebetween 0 and 1 truncated to 0 and aborted; the
R-levelassertIntegerish(size)rejected such values outright. Truncation
also made the log-likelihood a step function ofsize, so the dispersion
could not be estimated even when its true value was an integer. This
blockednbinomMu()models with continuous overdispersion innlmixr2.
sizemust now be strictly positive; non-positive values returnNA. The
INT_MAXbound added in 2.0.15 still applies toxeverywhere, and to
sizeforrxLlikBinomwheresizeis a number of trials. -
llikNbinom()andllikNbinomMu()now returnNAinstead of aborting the R
process when the mean handed to the underlying likelihood is out of domain.
This covers aprobof 0 (and, through the C API, aproboutside[0, 1]
or a negativemu), and -- becausesizeis no longer bounded byINT_MAX
-- a largesizewith a smallprobwhose product overflows. Previously
these threw a C++ exception that escaped therxLlikNbinom()/
rxLlikNbinomMu()entry points used byrxode2solves andfocei, killing
the session. -
llikNbinom()atprob == 1andllikNbinomMu()atmu == 0now match
stats::dnbinom(). The distribution is degenerate at zero there, sofxis
0(a likelihood of 1) atx == 0and-Infotherwise. These are the only
points wherestats::dnbinom()defines a value that the underlying Stan
likelihood cannot compute -- it requires a strictly positive mean. No
derivative exists at a point mass, sodProb/dMuareNA; an unusable
gradient beats aNAlog-likelihood, and beats the abort these used to
cause.prob == 0remainsNA, matching theNaNR returns there. -
Added more liklihood families and also added a ABI free header for
linking