Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
1 change: 1 addition & 0 deletions conda-envs/environment-alternative-backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies:
- pandas>=0.24.0
- pip
- pytensor>=3.2.2,<3.3
- pytensor-distributions>=0.2.0
Comment thread
juanitorduz marked this conversation as resolved.
Outdated
- python-graphviz
- networkx
- rich>=13.7.1
Expand Down
1 change: 1 addition & 0 deletions conda-envs/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- pandas>=0.24.0
- pip
- pytensor>=3.2.2,<3.3
- pytensor-distributions>=0.2.0
- python-graphviz
- networkx
- scipy>=1.4.1
Expand Down
1 change: 1 addition & 0 deletions conda-envs/environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- pandas>=0.24.0
- pip
- pytensor>=3.2.2,<3.3
- pytensor-distributions>=0.2.0
- python-graphviz
- rich>=13.7.1
- scipy>=1.4.1
Expand Down
1 change: 1 addition & 0 deletions conda-envs/environment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- pip
- polyagamma
- pytensor>=3.2.2,<3.3
- pytensor-distributions>=0.2.0
- python-graphviz
- networkx
- rich>=13.7.1
Expand Down
1 change: 1 addition & 0 deletions conda-envs/windows-environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies:
- pandas>=0.24.0
- pip
- pytensor>=3.2.2,<3.3
- pytensor-distributions>=0.2.0
- python-graphviz
- networkx
- rich>=13.7.1
Expand Down
1 change: 1 addition & 0 deletions conda-envs/windows-environment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies:
- pip
- polyagamma
- pytensor>=3.2.2,<3.3
- pytensor-distributions>=0.2.0
- python-graphviz
- networkx
- rich>=13.7.1
Expand Down
12 changes: 5 additions & 7 deletions pymc/distributions/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
from pytensor.tensor.random.op import RandomVariable
from pytensor.tensor.random.utils import normalize_size_param
from pytensor.tensor.variable import TensorConstant, TensorVariable
from pytensor_distributions import normal as ptd_normal

from pymc.distributions.custom import CustomDist
from pymc.logprob.abstract import _logprob_helper
Expand Down Expand Up @@ -524,32 +525,29 @@ def support_point(rv, size, mu, sigma):
return mu

def logp(value, mu, sigma):
res = -0.5 * pt.pow((value - mu) / sigma, 2) - pt.log(pt.sqrt(2.0 * np.pi)) - pt.log(sigma)
return check_parameters(
res,
ptd_normal.logpdf(value, mu, sigma),
sigma > 0,
msg="sigma > 0",
)

def logcdf(value, mu, sigma):
return check_parameters(
normal_lcdf(mu, sigma, value),
ptd_normal.logcdf(value, mu, sigma),
sigma > 0,
msg="sigma > 0",
)

def logccdf(value, mu, sigma):
return check_parameters(
normal_lccdf(mu, sigma, value),
ptd_normal.logsf(value, mu, sigma),
sigma > 0,
msg="sigma > 0",
)

def icdf(value, mu, sigma):
res = mu + sigma * -np.sqrt(2.0) * pt.erfcinv(2 * value)
res = check_icdf_value(res, value)
return check_icdf_parameters(
res,
ptd_normal.ppf(value, mu, sigma),
sigma > 0,
msg="sigma > 0",
)
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pandas>=0.24.0
polyagamma
pre-commit>=2.8.0
pymc-sphinx-theme>=0.16.0
pytensor-distributions>=0.2.0
pytensor>=3.2.2,<3.3
pytest-cov>=2.5
pytest>=3.0
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ cloudpickle
numpy>=1.25.0
pandas>=0.24.0
pytensor>=3.2.2,<3.3
pytensor-distributions>=0.2.0
rich>=13.7.1
scipy>=1.4.1
threadpoolctl>=3.1.0,<4.0.0
Expand Down
Loading