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

"From ... to" method for creating beta distribution #9

Open
erwald opened this issue Mar 16, 2023 · 2 comments
Open

"From ... to" method for creating beta distribution #9

erwald opened this issue Mar 16, 2023 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@erwald
Copy link
Contributor

erwald commented Mar 16, 2023

Currently you can create normal and lognormal distributions using x, y, and credibility parameters, e.g.:

def norm(x=None, y=None, credibility=90, mean=None, sd=None,
         lclip=None, rclip=None):

but the beta distribution initializer only takes alpha/beta values:

def beta(a, b):

It might be nice to also have the previous interface available for beta, like here.

  • x and y would need to be in the 0 <= i <= 1 range.
  • It'd either be a breaking change, or lead to inconsistent distribution creation interfaces. I.e. x, y, and credibility can't be the default arguments -- like they are for norm and lognormal -- without making this a breaking change.
  • Apparently calculating this is nontrivial, and maybe not that fast, which could be another problem.
@peterhurford
Copy link
Collaborator

I would like to see https://nunosempere.com/blog/2023/03/15/fit-beta/ implemented in squigglepy as an additional interface to beta. I'll have to think about how to best handle the important trade-offs you mentioned. Adding lclip and rclip sound reasonable too.

@peterhurford peterhurford added the enhancement New feature or request label Mar 16, 2023
@NunoSempere
Copy link

NunoSempere commented Mar 23, 2023

You can find an embryonic implementation of this in this pull request. Embryonic because it works in python, but the glue code for integrating it into Squigglepy is missing. Also see more details in the README.md in the pull request.

@peterhurford peterhurford added this to the v0.27 milestone Jun 10, 2023
@peterhurford peterhurford modified the milestones: v0.27, v0.28 Jul 2, 2023
@peterhurford peterhurford modified the milestones: v0.28, v0.29 Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants