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

Loss of precision in Weibull #1507

Open
benjamin-lieser opened this issue Oct 10, 2024 · 3 comments
Open

Loss of precision in Weibull #1507

benjamin-lieser opened this issue Oct 10, 2024 · 3 comments
Labels
E-question Participation: opinions wanted

Comments

@benjamin-lieser
Copy link
Collaborator

Weibull::new(1000.0, 0.001) will sample inf a decent number of times.
The expectation of 4.023873e+2570 can of course not be sampled.
The median of 6.7e-160 is reproduced well thought.

Do we want to allow this extreme values?
At least we should document the limits of the implementation/floating point

@benjamin-lieser benjamin-lieser added the E-question Participation: opinions wanted label Oct 10, 2024
@dhardy
Copy link
Member

dhardy commented Oct 11, 2024

It sounds like the algorithm is working correctly then, albeit the KS statistic is unable to test this where a significant portion of outputs are inf?

Unless we have grounds to believe an output is wrong (besides +/- inf) then I don't think we should disallow those parameters. (We could document which parameters were tested and/or which parameters might be expected to yield unrepresentable values.)

@benjamin-lieser
Copy link
Collaborator Author

I am pretty sure the output is correct, expect for the under and overflows.
0.0 is also more sampled than it should because of underflow, this makes the KS test fail. The same thing probably happens at the other end of the distribution with inf.

I would document the bounds at which a significant amount of samples will be the result of under or overflow.

@dhardy
Copy link
Member

dhardy commented Oct 11, 2024

Underflow to zero and subnormal samples can influence the shape of the CDF, thus affecting the test. It seems unlikely to be an issue in usage however; anyone working with very small outputs ought to already have an idea of the limits of FP precision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-question Participation: opinions wanted
Projects
None yet
Development

No branches or pull requests

2 participants