Skip to content

Commit 9b15633

Browse files
authored
Merge pull request #104 from SCIInstitute/gamma-scaling-fix
Fixed scaling issue
2 parents a1bdc39 + 1746dad commit 9b15633

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

UncertainSCI/distributions.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,18 +530,28 @@ def __init__(self, k=1., theta=1., shift=0., flip=False):
530530
b = np.zeros(self.dim)
531531
self.transform_standard_dist_to_poly = AffineTransform(A=A, b=b)
532532

533+
A = np.eye(self.dim)
533534
if not flip:
534535
A *= 1/self.theta
535536
else:
536537
A *= -1/self.theta
537-
538538
b = -A @ (self.shift*np.ones(1))
539539
self.transform_to_standard = AffineTransform(A=A, b=b)
540540

541541
# Construct 1D polynomial families
542542
Ls = []
543+
try:
544+
kiter = iter(self.k)
545+
kiter = True
546+
except:
547+
kiter = False
548+
543549
for qd in range(self.dim):
544-
Ls.append(LaguerrePolynomials())
550+
if kiter:
551+
Ls.append(LaguerrePolynomials(rho=k[qd]-1))
552+
else:
553+
Ls.append(LaguerrePolynomials(rho=k-1))
554+
545555
self.polys = TensorialPolynomials(polys1d=Ls)
546556

547557
self.standard_domain = np.zeros([2, 1])

0 commit comments

Comments
 (0)