causal-learn icon indicating copy to clipboard operation
causal-learn copied to clipboard

FCI algorithm with KCI testing method

Open Peng0618 opened this issue 3 years ago • 3 comments

Hello,

I am testing the fci algrithm and its defaul independence testing method is 'fisherz'. I tried to use the 'kci' testing method. But it shows:

TypeError: '(slice(None, None, None), [0])' is an invalid key.

So, is there any example about the fci algorithm with kci method? Thank you.

Peng0618 avatar Sep 09 '22 22:09 Peng0618

Thanks for reaching out. Could you please tell us your causal-learn version and the minimum code snippet that reproduces your issue?

Since G, edges = fci(data, 'kci', 0.05, verbose=False) should work.

MarkDana avatar Sep 09 '22 22:09 MarkDana

Hi, the causal-learn version is 0.1.2.8. Thanks for your sample. I have solved it.

BTW, the kci testing is much slower than fisherz, especially when the number of variables is large... But it is still a good choice.

Peng0618 avatar Sep 10 '22 05:09 Peng0618

Yep. kci is basically in O(n^3) time complexity, with n being the sample size.

The good thing is that kci is nonparametric, while fisherz only works for joint Gaussian.

MarkDana avatar Sep 25 '22 01:09 MarkDana