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

qbern() returns incorrect quantile for p = 0.1 when prob = 0.9 #34

Open
Tanjib423 opened this issue Dec 16, 2024 · 0 comments
Open

qbern() returns incorrect quantile for p = 0.1 when prob = 0.9 #34

Tanjib423 opened this issue Dec 16, 2024 · 0 comments

Comments

@Tanjib423
Copy link

Description:
The qbern() function appears to return 1 instead of 0 for the input p = 0.1, prob = 0.9, and lower.tail = TRUE. Based on the Bernoulli CDF, the expected result is 0, as P(X <= 0) = 0.1 satisfies the condition F(q) >= p.

Steps to Reproduce:

library(extraDistr)
qbern(p = 0.1, prob = 0.9, lower.tail = TRUE)
# Expected output: 0
# Actual output: 1



#################
R version: 4.1.2
Package version: 1.9.1
Operating system: Windows 10 x64 build 22631
################
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