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
Copy file name to clipboardExpand all lines: docs/source/independence_tests_index/chisq.rst
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,14 +5,29 @@ Chi-Square test
5
5
6
6
Perform an independence test on discrete variables using Chi-Square test.
7
7
8
-
(We have updated the independence test class and the usage example hasn't been updated yet. For new class, please refer to `TestCIT.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT.py>`_ or `TestCIT_KCI.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT_KCI.py>`_.)
9
-
10
8
Usage
11
9
--------
12
10
.. code-block:: python
13
11
12
+
from causallearn.utils.cit importCIT
13
+
chisq_obj = CIT(data, "chisq") # construct a CIT instance with data and method name
14
+
pValue = chisq_obj(X, Y, S)
15
+
16
+
Please be kindly informed that we have refactored the independence tests from functions to classes since the release `v0.1.2.8 <https://github.com/cmu-phil/causal-learn/releases/tag/0.1.2.8>`_. Speed gain and a more flexible parameters specification are enabled.
17
+
18
+
For users, you may need to adjust your codes accordingly. Specifically, if you are
19
+
20
+
+ running a constraint-based algorithm from end to end: then you don't need to change anything. Old codes are still compatible. For example,
21
+
.. code-block:: python
22
+
23
+
from causallearn.search.ConstraintBased.PCimport pc
14
24
from causallearn.utils.cit import chisq
15
-
p = chisq(data, X, Y, conditioning_set)
25
+
cg = pc(data, 0.05, chisq)
26
+
27
+
+ explicitly calculating the p-value of a test: then you need to declare the :code:`chisq_obj` and then call it as above, instead of using :code:`chisq(data, X, Y, condition_set)` as before. Note that now :code:`causallearn.utils.cit.chisq` is a string :code:`"chisq"`, instead of a function.
28
+
29
+
Please see `CIT.py <https://github.com/cmu-phil/causal-learn/blob/main/causallearn/utils/cit.py>`_
30
+
for more details on the implementation of the (conditional) independent tests.
Copy file name to clipboardExpand all lines: docs/source/independence_tests_index/fisherz.rst
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,31 @@ Fisher-z test
5
5
6
6
Perform an independence test using Fisher-z's test [1]_. This test is optimal for linear-Gaussian data.
7
7
8
-
(We have updated the independence test class and the usage example hasn't been updated yet. For new class, please refer to `TestCIT.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT.py>`_ or `TestCIT_KCI.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT_KCI.py>`_.)
9
-
10
8
11
9
Usage
12
10
--------
13
11
.. code-block:: python
14
12
13
+
from causallearn.utils.cit importCIT
14
+
fisherz_obj = CIT(data, "fisherz") # construct a CIT instance with data and method name
15
+
pValue = fisherz_obj(X, Y, S)
16
+
17
+
Please be kindly informed that we have refactored the independence tests from functions to classes since the release `v0.1.2.8 <https://github.com/cmu-phil/causal-learn/releases/tag/0.1.2.8>`_. Speed gain and a more flexible parameters specification are enabled.
18
+
19
+
For users, you may need to adjust your codes accordingly. Specifically,
20
+
21
+
+ If you are running a constraint-based algorithm from end to end: then you don't need to change anything. Old codes are still compatible. For example,
22
+
.. code-block:: python
23
+
24
+
from causallearn.search.ConstraintBased.PCimport pc
15
25
from causallearn.utils.cit import fisherz
16
-
p = fisherz(data, X, Y, condition_set, correlation_matrix)
26
+
cg = pc(data, 0.05, fisherz)
27
+
28
+
+ If you are explicitly calculating the p-value of a test: then you need to declare the :code:`fisherz_obj` and then call it as above, instead of using :code:`fisherz(data, X, Y, condition_set)` as before. Note that now :code:`causallearn.utils.cit.fisherz` is a string :code:`"fisherz"`, instead of a function.
29
+
30
+
31
+
Please see `CIT.py <https://github.com/cmu-phil/causal-learn/blob/main/causallearn/utils/cit.py>`_
32
+
for more details on the implementation of the (conditional) independent tests.
Copy file name to clipboardExpand all lines: docs/source/independence_tests_index/gsq.rst
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,29 @@ G-Square test
5
5
6
6
Perform an independence test using G-Square test [1]_. This test is based on the log likelihood ratio test.
7
7
8
-
(We have updated the independence test class and the usage example hasn't been updated yet. For new class, please refer to `TestCIT.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT.py>`_ or `TestCIT_KCI.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT_KCI.py>`_.)
9
-
10
-
11
8
Usage
12
9
--------
13
10
.. code-block:: python
14
11
12
+
from causallearn.utils.cit importCIT
13
+
gsq_obj = CIT(data, "gsq") # construct a CIT instance with data and method name
14
+
pValue = gsq_obj(X, Y, S)
15
+
16
+
Please be kindly informed that we have refactored the independence tests from functions to classes since the release `v0.1.2.8 <https://github.com/cmu-phil/causal-learn/releases/tag/0.1.2.8>`_. Speed gain and a more flexible parameters specification are enabled.
17
+
18
+
For users, you may need to adjust your codes accordingly. Specifically, if you are
19
+
20
+
+ running a constraint-based algorithm from end to end: then you don't need to change anything. Old codes are still compatible. For example,
21
+
.. code-block:: python
22
+
23
+
from causallearn.search.ConstraintBased.PCimport pc
15
24
from causallearn.utils.cit import gsq
16
-
p = gsq(data, X, Y, conditioning_set)
25
+
cg = pc(data, 0.05, gsq)
26
+
27
+
+ explicitly calculating the p-value of a test: then you need to declare the :code:`gsq_obj` and then call it as above, instead of using :code:`gsq(data, X, Y, condition_set)` as before. Note that now :code:`causallearn.utils.cit.gsq` is a string :code:`"gsq"`, instead of a function.
28
+
29
+
Please see `CIT.py <https://github.com/cmu-phil/causal-learn/blob/main/causallearn/utils/cit.py>`_
30
+
for more details on the implementation of the (conditional) independent tests.
Copy file name to clipboardExpand all lines: docs/source/independence_tests_index/kci.rst
+28-4Lines changed: 28 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,39 @@ Kernel-based conditional independence (KCI) test and independence test [1]_.
7
7
To test if x and y are conditionally or unconditionally independent on Z. For unconditional independence tests,
8
8
Z is set to the empty set.
9
9
10
-
(We have updated the independence test class and the usage example hasn't been updated yet. For new class, please refer to `TestCIT.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT.py>`_ or `TestCIT_KCI.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT_KCI.py>`_.)
11
-
12
-
13
10
Usage
14
11
--------
15
12
.. code-block:: python
16
13
14
+
from causallearn.utils.cit importCIT
15
+
kci_obj = CIT(data, "kci") # construct a CIT instance with data and method name
16
+
pValue = kci_obj(X, Y, S)
17
+
18
+
The above code runs KCI with the default parameters. Or instead if you would like to specify some parameters of KCI, you may do it by e.g.,
See `KCI.py <https://github.com/cmu-phil/causal-learn/blob/main/causallearn/utils/KCI/KCI.py>`_
25
+
for more details on the parameters options of the KCI tests.
26
+
27
+
28
+
Please be kindly informed that we have refactored the independence tests from functions to classes since the release `v0.1.2.8 <https://github.com/cmu-phil/causal-learn/releases/tag/0.1.2.8>`_. Speed gain and a more flexible parameters specification are enabled.
29
+
30
+
For users, you may need to adjust your codes accordingly. Specifically, if you are
31
+
32
+
+ running a constraint-based algorithm from end to end: then you don't need to change anything. Old codes are still compatible. For example,
33
+
.. code-block:: python
34
+
35
+
from causallearn.search.ConstraintBased.PCimport pc
17
36
from causallearn.utils.cit import kci
18
-
p = kci(data, X, Y, condition_set, kernelX, kernelY, kernelZ, est_width, polyd, kwidthx, kwidthy, kwidthz)
37
+
cg = pc(data, 0.05, kci)
38
+
39
+
+ explicitly calculating the p-value of a test: then you need to declare the :code:`kci_obj` and then call it as above, instead of using :code:`kci(data, X, Y, condition_set)` as before. Note that now :code:`causallearn.utils.cit.kci` is a string :code:`"kci"`, instead of a function.
40
+
41
+
Please see `CIT.py <https://github.com/cmu-phil/causal-learn/blob/main/causallearn/utils/cit.py>`_
42
+
for more details on the implementation of the (conditional) independent tests.
Copy file name to clipboardExpand all lines: docs/source/independence_tests_index/mvfisherz.rst
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,29 @@ Missing-value Fisher-z test
6
6
Perform a testwise-deletion Fisher-z independence test to data sets with missing values.
7
7
With testwise-deletion, the test makes use of all data points that do not have missing values for the variables involved in the test.
8
8
9
-
(We have updated the independence test class and the usage example hasn't been updated yet. For new class, please refer to `TestCIT.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT.py>`_ or `TestCIT_KCI.py <https://github.com/cmu-phil/causal-learn/blob/main/tests/TestCIT_KCI.py>`_.)
10
-
11
-
12
9
Usage
13
10
--------
14
11
.. code-block:: python
15
12
13
+
from causallearn.utils.cit importCIT
14
+
mv_fisherz_obj = CIT(data_with_missingness, "mv_fisherz") # construct a CIT instance with data and method name
15
+
pValue = mv_fisherz_obj(X, Y, S)
16
+
17
+
Please be kindly informed that we have refactored the independence tests from functions to classes since the release `v0.1.2.8 <https://github.com/cmu-phil/causal-learn/releases/tag/0.1.2.8>`_. Speed gain and a more flexible parameters specification are enabled.
18
+
19
+
For users, you may need to adjust your codes accordingly. Specifically, if you are
20
+
21
+
+ running a constraint-based algorithm from end to end: then you don't need to change anything. Old codes are still compatible. For example,
22
+
.. code-block:: python
23
+
24
+
from causallearn.search.ConstraintBased.PCimport pc
16
25
from causallearn.utils.cit import mv_fisherz
17
-
p = mv_fisherz(mvdata, X, Y, condition_set)
26
+
cg = pc(data_with_missingness, 0.05, mv_fisherz)
27
+
28
+
+ explicitly calculating the p-value of a test: then you need to declare the :code:`mv_fisherz_obj` and then call it as above, instead of using :code:`mv_fisherz(data, X, Y, condition_set)` as before. Note that now :code:`causallearn.utils.cit.mv_fisherz` is a string :code:`"mv_fisherz"`, instead of a function.
29
+
30
+
Please see `CIT.py <https://github.com/cmu-phil/causal-learn/blob/main/causallearn/utils/cit.py>`_
31
+
for more details on the implementation of the (conditional) independent tests.
0 commit comments