Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raanan-rohekar committed Nov 18, 2024
1 parent 4282eb1 commit 743194b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions causal_discovery_utils/cond_indep_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,12 @@ def is_edge_retained(self, x, y):

class CondIndepParCorr(StatCondIndep):
def __init__(self, threshold, dataset, weights=None, retained_edges=None, count_tests=False, use_cache=False,
num_records=None, num_vars=None):
num_records=None, num_vars=None, verbose=False):
if weights is not None:
raise Exception('weighted Partial-correlation is not supported. Please avoid using weights.')
super().__init__(dataset, threshold, database_type=float, weights=weights, retained_edges=retained_edges,
count_tests=count_tests, use_cache=use_cache, num_records=num_records, num_vars=num_vars)
count_tests=count_tests, use_cache=use_cache, num_records=num_records, num_vars=num_vars,
verbose=verbose)

self.correlation_matrix = None
if self.data is not None:
Expand Down Expand Up @@ -330,7 +331,7 @@ def calc_statistic(self, x, y, zz):
if par_corr >= 1.0:
return 0
if par_corr <= 0:
return np.infty
return np.inf

degrees_of_freedom = self.num_records - (len(zz) + 2) # degrees of freedom to be used to calculate p-value

Expand Down

0 comments on commit 743194b

Please sign in to comment.