frites.estimator.DcorrEstimator#
- class frites.estimator.DcorrEstimator(implementation='auto', verbose=None)[source]#
Distance correlation-based estimator.
This estimator can be used to estimate the correlation between two continuous variables (mi_type=’cc’).
- Parameters
- implementation{‘auto’, ‘frites’, ‘dcor’}
Choose wich implementation of the distance correlation to use. If ‘frites’ a home-made version is going to be used. If ‘dcor’, the one of the dcorr package is going to be preferred (see for installation https://dcor.readthedocs.io/).
Methods
estimate
(x, y[, z, categories])Estimate the distance correlation between two variables.
Get the function to execute according to the input parameters.
- estimate(x, y, z=None, categories=None)[source]#
Estimate the distance correlation between two variables.
This method is made for computing the correlation on 3D variables (i.e (n_var, n_mv, n_samples)) where n_var is an additional dimension (e.g times, times x freqs etc.)n_mv is a multivariate axis and n_samples the number of samples.
- Parameters
- x, ynumpy:array_like
Array of shape (n_var, n_mv, n_samples).
- categoriesnumpy:array_like |
python:None
Row vector of categories. This vector should have a shape of (n_samples,) and should contains integers describing the category of each sample.
- Returns
- corrnumpy:array_like
Array of correlation of shape (n_categories, n_var).
Examples using
estimate
:Trial-resampling: correcting for unbalanced designs
Trial-resampling: correcting for unbalanced designsEstimator comparison
- get_function()[source]#
Get the function to execute according to the input parameters.
This can be particularly useful when computing correlation in parallel as it avoids to pickle the whole estimator and therefore, leading to faster computations.
The returned function has the following signature :
and return an array of shape (n_categories, n_var).
Examples using frites.estimator.DcorrEstimator
#
Estimate the Dynamic Functional Connectivity
Trial-resampling: correcting for unbalanced designs