Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PC algorithm rule4 #103

Open
kenneth-lee-ch opened this issue May 18, 2023 · 0 comments
Open

PC algorithm rule4 #103

kenneth-lee-ch opened this issue May 18, 2023 · 0 comments
Assignees

Comments

@kenneth-lee-ch
Copy link

kenneth-lee-ch commented May 18, 2023

Hi,

  1. Why would the PC implemented in pc.py in the gCastle package strictly use rule 4 even without background knowledge?
  # rule4
                for i, j in permutations(ij, 2):
                    for kj in sep_set.keys():  # k and j are nonadjacent.
                        if j not in kj:
                            continue
                        else:
                            kj = list(kj)
                            kj.remove(j)
                            k = kj[0]
                            ls = [x for x in columns if x not in [i, j, k]]
                            for l in ls:
                                if cpdag[k, l] == 1 \
                                        and cpdag[l, k] == 0 \
                                        and cpdag[i, k] == 1 \
                                        and cpdag[k, i] == 1 \
                                        and cpdag[l, j] == 1 \
                                        and cpdag[j, l] == 0:
                                    cpdag[j, i] = 0
  1. One more question, don't we need to have cpdag[l, i] == 1 and cpdag[i, l] ==1 in the if condition?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants