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

floating point issue: cdf returns value > 1 #31

Open
elray1 opened this issue Mar 8, 2024 · 0 comments
Open

floating point issue: cdf returns value > 1 #31

elray1 opened this issue Mar 8, 2024 · 0 comments

Comments

@elray1
Copy link
Contributor

elray1 commented Mar 8, 2024

ps <- c(0.01, 0.025, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 
0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 0.975, 
0.99)
qs <- c(0, 0, 0, 0.103331351093582, 0.206662702187163, 0.258328377733954, 
0.309994053280745, 0.309994053280745, 0.361659728827535, 0.361659728827535, 
0.413325404374326, 0.413325404374326, 0.413325404374326, 0.464991079921117, 
0.464991079921117, 0.516656755467908, 0.516656755467908, 0.568322431014698, 
0.619988106561489, 0.723319457655071, 0.878316484295443, 1.08497918648261, 
1.29164188866977)

result <- distfromq::make_p_fn(ps=ps, qs=qs)(25)
result > 1
# TRUE
result - 1
# 2.220446e-16
@elray1 elray1 mentioned this issue Mar 8, 2024
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