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

x_min and x_max can be far too conservative #61

Open
zmbc opened this issue Jul 15, 2024 · 6 comments
Open

x_min and x_max can be far too conservative #61

zmbc opened this issue Jul 15, 2024 · 6 comments

Comments

@zmbc
Copy link

zmbc commented Jul 15, 2024

My understanding is that x_min and x_max, for the non-mirrored distributions, act only as "guardrails" against trying to compute something that we don't have precision to compute. They are approximated using a lognormal distribution, but this approximation can be quite bad. Then the "guardrails" become far too restrictive and prevent the user from computing something that they can totally compute with their precision.

MCVE:

>>> import risk_distributions
>>> g = risk_distributions.risk_distributions.Gamma(risk_distributions.risk_distributions.Gamma.get_parameters(mean=100_017, sd=100_000.7))
>>> g.cdf(g.parameters.x_min)
0    0.052517
dtype: float64
>>> g = risk_distributions.risk_distributions.Gamma(risk_distributions.risk_distributions.Gamma.get_parameters(mean=100_017, sd=500_000.7))
>>> g.cdf(g.parameters.x_min)
0    0.673451
dtype: float64
@NathanielBlairStahn
Copy link

@zmbc I've never understood what x_min and x_max were for -- could you explain further? Also, I don't understand what exactly your example is showing, except that it seems like the CDF at a value we're calling "x min" shouldn't be as high as 67% or even 5%. But as I said, I don't know what x_min and x_max are actually for, so I don't know what this means.

@NathanielBlairStahn
Copy link

NathanielBlairStahn commented Jul 15, 2024

Seems like this note from @alibow in our documentation of enesemble distributions is relevant. And the linked notebook.

@zmbc
Copy link
Author

zmbc commented Jul 15, 2024

it seems like the CDF at a value we're calling "x min" shouldn't be as high as 67% or even 5%

Yep that's it!

x_min and x_max are supposed to represent the support of the distribution in some numerical, computable sense. They have additional effects on mirrored distributions, which are what those notes and notebooks are about. In the case of mirrored distributions, it is important to match GBD, so the auto-generated x_min and x_max from this package should be used with caution!

@zmbc
Copy link
Author

zmbc commented Jul 15, 2024

@NathanielBlairStahn
Copy link

They are approximated using a normal distribution

Do you mean lognormal?

@zmbc
Copy link
Author

zmbc commented Jul 15, 2024

Oops, yes!

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

2 participants