You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is the code from copulas/multivariate/tree.py
The inner loop(j loop) repeatedly calculates kendalltau for the same data, and the columns of tau matrix are all the same.
def get_tau_matrix(self):
num_edges = len(self.edges)
tau = np.empty([num_edges, num_edges])
for i in range(num_edges):
edge = self.edges[i]
for j in edge.neighbors:
if self.level == 1:
left_u = self.u_matrix[:, edge.L]
right_u = self.u_matrix[:, edge.R]
else:
left_parent, right_parent = edge.parents
left_u, right_u = Edge.get_conditional_uni(left_parent, right_parent)
# left_u and right_u are the same for different j's.
tau[i, j], pvalue = scipy.stats.kendalltau(left_u, right_u)
return tau
The text was updated successfully, but these errors were encountered:
faniuy
changed the title
Why is there a LOT of repeated calculations in Tree.get_tau_matrix()? possibly bug?
Why are there a LOT of repeated calculations in Tree.get_tau_matrix()? possibly bug?
Mar 1, 2022
Below is the code from copulas/multivariate/tree.py
The inner loop(j loop) repeatedly calculates kendalltau for the same data, and the columns of tau matrix are all the same.
The text was updated successfully, but these errors were encountered: