Skip to content

Commit

Permalink
Merge pull request #108 from UBC-MDS/implementation/qnorm
Browse files Browse the repository at this point in the history
fix: updated qnorm documentation and test design - feedback addressed by Jason Lee
  • Loading branch information
AbdulSafdar authored Jan 30, 2025
2 parents ab8cb84 + cb1f0c6 commit 3990be5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pystats_norm/qnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ def qnorm(p, mean=0, sd=1, lower_tail=True):
Parameters
----------
p: np.float64
The probability for which to find the quantile.
The probability for which to find the quantile. Must be between 0 and 1 (exclusive).
mean: np.float64, optional
The mean (average) of the normal distribution. Default is 0.
std_dev: np.float64, optional
sd: np.float64, optional
The standard deviation of the normal distribution. Default is 1.
lower_tail: bool, optional
Expand Down
4 changes: 3 additions & 1 deletion tests/test_qnorm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def test_output_datatype():
(0.95, 0, 1, True, norm.ppf(0.95)),
(0.95, 0, 1, False, norm.isf(0.95)),
(0.99, 0, 1, True, norm.ppf(0.99)),
(0.99, 0, 1, False, norm.isf(0.99))
(0.99, 0, 1, False, norm.isf(0.99)),
(0.99, 10, 5, True, norm.ppf(0.99, 10, 5)),
(0.99, 10, 5, False, norm.isf(0.99, 10, 5))
]
)
def test_normal_cases(p, mean, sd, lower_tail, expected, tol=1e-6):
Expand Down

0 comments on commit 3990be5

Please sign in to comment.