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

make all distribution calculations up front #170

Open
mjskay opened this issue Feb 15, 2023 · 0 comments
Open

make all distribution calculations up front #170

mjskay opened this issue Feb 15, 2023 · 0 comments

Comments

@mjskay
Copy link
Owner

mjskay commented Feb 15, 2023

Should be able to separate out the calculation parts and the presentation parts, which will simplify some stuff (like the sharing of slab and interval calculations). Basically a pipeline like:

  1. Group everything and create objects that will store distribution information. Probably environments or R6 objects
  2. Fill in the limits on those objects implied by the chosen density estimator. i.e. what is currently in compute_limits()
  3. Fill in slab / interval / etc calculations. i.e. most of what is currently in compute_slab() and compute_intervals() but instead of putting them in the format for the data, store them internally, to be composed later. This would include calculating intervals, a grid, and density functions and intervals against that grid. Would also keep the pdf, cdf, and quantile functions for each dist around in its object for use later.
  4. In stages, compose the datatype sections of output (slab and interval). e.g. the slab portion would use the grid + function evaluations as its basis, but add in interval containment info. The interval portion would use the interval evaluations as its basis, but add in pdf and cdf evaluations using the stored dist functions.

This should allow us to eliminate some duplicate work and also drop the use of the approximation functions for slab functions later (or, in the sample case, we can make these the stored functions).

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