cardioception.reports.preprocessing#

cardioception.reports.preprocessing(results: Union[PathLike, DataFrame]) DataFrame[source]#

From the main behavioural data frame, extract summary metrics of behavioural, metacognitive and interoceptive performances.

The slope and thresholds of the interoceptive/exteroceptive psychometric function are reported both using the online estimate outputted by the Psi staircase (i.e. slope and threshold), and using a Bayesian estimation (i.e. bayesian_slope and bayesian_threshold). The Bayesian estimation is the recommended value to use to report the results. Removing outliers before fitting will change the estimation, which is not the case for the Psi values.

The d-prime and criterion are also computed using a classical SDT approach (dprime and criterion), as well as a Bayesian estimation performed when estimating the metacognitive sensitivity meta-d’ (bayesian_dprime, bayesian_criterion, bayesian_meta_d, bayesian_m_ratio). The dprime and criterion can vary between the two methods. It is recommended to use the estimates consistently. Before the estimation of SDT and metacognitive metrics, the function ensure that at least 5 valid trials of each signal are present, otherwise returns None.

When using this function for analysing results from the Heart Rate Discrimination task, the following packages should be credited: Systole [1], metadpy [2] and cardioception [3].

Parameters
resultspd.DataFrame | PathLike

Either the path to the result file, or the Pandas Data Frame.

Returns
summary_dfpd.DataFrame

The summary statistic for this participant, splitting for interoception and exteroception if the two conditions were used.

Notes

This function will require [PyMC](pymc-devs/pymc) (>= 5.0) and [metadpy](embodied-computation-group/metadpy) (>=0.1.0).

References

1

Legrand et al., (2022). Systole: A python package for cardiac signal synchrony and analysis. Journal of Open Source Software, 7(69), 3832, https://doi.org/10.21105/joss.03832

2

embodied-computation-group/metadpy

3

Legrand, N., Nikolova, N., Correa, C., Brændholt, M., Stuckert, A., Kildahl, N., Vejlø, M., Fardo, F., & Allen, M. (2021). The Heart Rate Discrimination Task: A psychophysical method to estimate the accuracy and precision of interoceptive beliefs. Biological Psychology, 108239. https://doi.org/10.1016/j.biopsycho.2021.108239