1.2.1. pywhy_stats.independence.fisherz#
Independence test using Fisher-Z’s test.
This test is also known as the partial correlation independence test. It works on Gaussian random variables.
When the data is not Gaussian, this test is not valid. In this case, we recommend
using the Kernel independence test at pywhy_stats.kci
.
1.2.1.1. Examples#
>>> import pywhy_stats as ps
>>> res = ps.fisherz.ind([1, 2, 3], [4, 5, 6])
>>> print(res.pvalue)
>>> 1.0
Functions
|
Perform a conditional independence test using Fisher-Z's test. |
|
Perform an independence test using Fisher-Z's test. |
- condind(X, Y, condition_on, correlation_matrix=None)[source]#
Perform a conditional independence test using Fisher-Z’s test.
- Parameters:
- Xarray_like of shape (n_samples,)
The first node variable.
- Yarray_like of shape (n_samples,)
The second node variable.
- condition_onarray_like of shape (n_samples, n_variables)
The conditioning set.
- correlation_matrixarray_like of shape (2 + n_variables, 2 + n_variables), optional
The precomputed correlation matrix between X, Y and
condition_on
, by default None.
- Returns:
- ind(X, Y, correlation_matrix=None)[source]#
Perform an independence test using Fisher-Z’s test.
Works on Gaussian random variables. This test is also known as the correlation test.
- Parameters:
- Xarray_like of shape (n_samples,)
The first node variable.
- Yarray_like of shape (n_samples,)
The second node variable.
- correlation_matrixarray_like of shape (2, 2), optional
The precomputed correlation matrix between X and Y., by default None.
- Returns: