You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the creation of dst_parametric() for specifying a distribution from any parametric family, comes a challenge of navigating the discrete values in these distributions with functions like next_discrete() -- how can a user specify where the discrete values are?
One idea is to specify the discrete values directly in the dst_parametric() function. Could have a new argument, like .discretes. Perhaps better, draw inspiration from the glm() function, whose family can be specified as a string (e.g., "binomial") or a function (e.g., binomial()) -- we can have the same for the .variable argument, with "discrete" as the string option and discrete() as the function option. Some ideas:
# Binomial
.variable = discrete(values = 0:size) # size as a function variable, or perhaps in reference to the `size` argument.
# Poisson
.variable = discrete(values = 0:Inf) # with this special type of "vector" allowed
.variable = discrete(values = "natural")
# For full control, specify the discrete finders directly:
.variable = discrete(next_discrete = function(...) ..., prev_discrete = function(...) ...)
Another option is to view these discrete finders as being "nice to have", and not relying on them per se. After all, that's really their only purpose, so that specifically quantile functions can be calculated more effectively when inverting a cdf (say of a mixture distribution, where we can't just call the q<dist>() function). This philosophy would jibe well with .variable = "discrete", which would just make do without any knowledge of the location of its discrete values (or we could rely on the existence of the q<dist>() function to collect a few discrete values).
The text was updated successfully, but these errors were encountered:
With the creation of
dst_parametric()
for specifying a distribution from any parametric family, comes a challenge of navigating the discrete values in these distributions with functions likenext_discrete()
-- how can a user specify where the discrete values are?One idea is to specify the discrete values directly in the
dst_parametric()
function. Could have a new argument, like.discretes
. Perhaps better, draw inspiration from theglm()
function, whosefamily
can be specified as a string (e.g.,"binomial"
) or a function (e.g.,binomial()
) -- we can have the same for the.variable
argument, with"discrete"
as the string option anddiscrete()
as the function option. Some ideas:Another option is to view these discrete finders as being "nice to have", and not relying on them per se. After all, that's really their only purpose, so that specifically quantile functions can be calculated more effectively when inverting a cdf (say of a mixture distribution, where we can't just call the
q<dist>()
function). This philosophy would jibe well with.variable = "discrete"
, which would just make do without any knowledge of the location of its discrete values (or we could rely on the existence of theq<dist>()
function to collect a few discrete values).The text was updated successfully, but these errors were encountered: