Skip to content

Commit

Permalink
final updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bja43 committed Jul 18, 2024
1 parent 9ea1fed commit 5399515
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions causallearn/score/LocalScoreFunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ def local_score_BIC(Data: ndarray, i: int, PAi: List[int], parameters=None) -> f
if len(PAi) == 0:
return n * np.log(cov[i, i])

yX = np.mat(cov[np.ix_([i], PAi)])
XX = np.mat(cov[np.ix_(PAi, PAi)])
H = np.log(cov[i, i] - yX * np.linalg.inv(XX) * yX.T)
yX = cov[np.ix_([i], PAi)]
XX = cov[np.ix_(PAi, PAi)]
H = np.log(cov[i, i] - yX @ np.linalg.inv(XX) @ yX.T)

return n * H + np.log(n) * len(PAi) * lambda_value

Expand Down Expand Up @@ -68,9 +68,9 @@ def local_score_BIC_from_cov(
if len(PAi) == 0:
return n * np.log(cov[i, i])

yX = np.mat(cov[np.ix_([i], PAi)])
XX = np.mat(cov[np.ix_(PAi, PAi)])
H = np.log(cov[i, i] - yX * np.linalg.inv(XX) * yX.T)
yX = cov[np.ix_([i], PAi)]
XX = cov[np.ix_(PAi, PAi)]
H = np.log(cov[i, i] - yX @ np.linalg.inv(XX) @ yX.T)

return n * H + np.log(n) * len(PAi) * lambda_value

Expand Down

0 comments on commit 5399515

Please sign in to comment.