Skip to content

Commit abf8c69

Browse files
committed
correct moment method
1 parent 19b411f commit abf8c69

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

chaospy/distributions/collection/trunc_normal.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Truncated normal distribution."""
2+
23
import numpy
3-
from scipy import special
44
from scipy.stats import truncnorm, norm
55
import chaospy
66

@@ -47,6 +47,9 @@ def _upper(self, a, b, mu, sigma):
4747
return numpy.where(b > upper, upper, b)
4848

4949
def _mom(self, n, a, b, mu, sigma):
50+
print(a, b, mu, sigma)
51+
a = (a - mu) / sigma
52+
b = (b - mu) / sigma
5053
return truncnorm.moment(
5154
n.item(), a.item(), b.item(), loc=mu.item(), scale=sigma.item()
5255
)

0 commit comments

Comments
 (0)