Skip to content

Commit

Permalink
Merge pull request #104 from SCIInstitute/gamma-scaling-fix
Browse files Browse the repository at this point in the history
Fixed scaling issue
  • Loading branch information
akilnarayan authored Sep 27, 2022
2 parents a1bdc39 + 1746dad commit 9b15633
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions UncertainSCI/distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,18 +530,28 @@ def __init__(self, k=1., theta=1., shift=0., flip=False):
b = np.zeros(self.dim)
self.transform_standard_dist_to_poly = AffineTransform(A=A, b=b)

A = np.eye(self.dim)
if not flip:
A *= 1/self.theta
else:
A *= -1/self.theta

b = -A @ (self.shift*np.ones(1))
self.transform_to_standard = AffineTransform(A=A, b=b)

# Construct 1D polynomial families
Ls = []
try:
kiter = iter(self.k)
kiter = True
except:
kiter = False

for qd in range(self.dim):
Ls.append(LaguerrePolynomials())
if kiter:
Ls.append(LaguerrePolynomials(rho=k[qd]-1))
else:
Ls.append(LaguerrePolynomials(rho=k-1))

self.polys = TensorialPolynomials(polys1d=Ls)

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

0 comments on commit 9b15633

Please sign in to comment.