Skip to content

Commit

Permalink
Update Utilities.py
Browse files Browse the repository at this point in the history
Fix bug in _get_a_plus
  • Loading branch information
dgiovanis authored Oct 20, 2020
1 parent 7825789 commit 80884c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/UQpy/Utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,22 +337,22 @@ def _bi_variate_normal_pdf(x1, x2, rho):

def _get_a_plus(a):
eig_val, eig_vec = np.linalg.eig(a)
q = np.array(eig_vec)
x_diagonal = np.array(np.diag(np.maximum(eig_val, 0)))
q = np.matrix(eig_vec)
x_diagonal = np.matrix(np.diag(np.maximum(eig_val, 0)))

return q * x_diagonal * q.T


def _get_ps(a, w=None):
w05 = np.array(w ** .5)
w05 = np.matrix(w ** .5)

return w05.I * _get_a_plus(w05 * a * w05) * w05.I


def _get_pu(a, w=None):
a_ret = np.array(a.copy())
a_ret[w > 0] = np.array(w)[w > 0]
return np.array(a_ret)
return np.matrix(a_ret)


def _nn_coord(x, k):
Expand Down

0 comments on commit 80884c6

Please sign in to comment.