Skip to content

overhaul gp docstrings #6609

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
03a0267
overhaul gp docstrings
daniel-saunders-phil Mar 17, 2023
67925df
Fix a typo in the docstring of OderedLogistic (#6611)
NathanielF Mar 18, 2023
473c952
Implement icdf for Univariate distribution (#6528)
michaelraczycki Mar 19, 2023
067d89b
Improved docstring for predictions argument in sample_posterior_predi…
fonnesbeck Mar 22, 2023
2fcce43
Added ICDF for the discrete uniform distribution.
gokuld Mar 23, 2023
bb4e7a1
overhaul gp docstrings
daniel-saunders-phil Mar 17, 2023
40d4c30
revised updates to gp docstrings
daniel-saunders-phil Mar 24, 2023
a24b74b
Merge branch 'docstring' of github.com:daniel-saunders-phil/pymc into…
daniel-saunders-phil Mar 24, 2023
2a62c0e
correcting errors introduced in last push
daniel-saunders-phil Mar 24, 2023
b94ba08
second attempt to fix duplication errors
daniel-saunders-phil Mar 25, 2023
48a0292
references to pymc.mvstudentt and similar weren't rendering correctly…
daniel-saunders-phil Mar 25, 2023
955d4a9
implementing Oriol's suggestions
daniel-saunders-phil Mar 29, 2023
e09c17a
second attempt to fix duplication errors
daniel-saunders-phil Mar 25, 2023
031ee71
references to pymc.mvstudentt and similar weren't rendering correctly…
daniel-saunders-phil Mar 25, 2023
b506171
implementing Oriol's suggestions
daniel-saunders-phil Mar 29, 2023
b528822
Revert "Implement icdf for Univariate distribution (#6528)"
daniel-saunders-phil Apr 2, 2023
efa315c
Revert "Revert "Implement icdf for Univariate distribution (#6528)""
daniel-saunders-phil Apr 2, 2023
8cdc77c
Merge branch 'docstring' of github.com:daniel-saunders-phil/pymc into…
daniel-saunders-phil Apr 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pymc/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ def logcdf(value, lower, upper):
msg="lower <= upper",
)

def icdf(value, lower, upper):
res = lower + (upper - lower) * value
res = check_icdf_value(res, value)
return check_icdf_parameters(res, lower < upper)


@_default_transform.register(Uniform)
def uniform_default_transform(op, rv):
Expand Down
11 changes: 10 additions & 1 deletion pymc/distributions/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -1058,6 +1058,15 @@ def logcdf(value, lower, upper):
msg="lower <= upper",
)

def icdf(value, lower, upper):
res = pt.ceil(value * (upper - lower + 1)).astype("int64") + lower - 1
res = check_icdf_value(res, value)
return check_icdf_parameters(
res,
lower <= upper,
msg="lower <= upper",
)


class Categorical(Discrete):
R"""
Expand Down Expand Up @@ -1572,7 +1581,7 @@ class OrderedLogistic:
# Ordered logistic regression
with pm.Model() as model:
cutpoints = pm.Normal("cutpoints", mu=[-1,1], sigma=10, shape=2,
transform=pm.distributions.transforms.ordered)
transform=pm.distributions.transforms.univariate_ordered)
y_ = pm.OrderedLogistic("y", cutpoints=cutpoints, eta=x, observed=y)
idata = pm.sample()

Expand Down
Loading