Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking discrete values in parametric families #23

Open
vincenzocoia opened this issue Nov 20, 2021 · 0 comments
Open

Tracking discrete values in parametric families #23

vincenzocoia opened this issue Nov 20, 2021 · 0 comments

Comments

@vincenzocoia
Copy link
Collaborator

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant