Skip to content

BioSIP/BayesianPAC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

BayesianPAC

This repository contains the core implementation of the Bayesian Phase-Amplitude Coupling (PAC) model presented in our manuscript on EEG-based analysis of reading difficulties in children. The approach uses probabilistic modeling to estimate directional connectivity between EEG channels while accounting for uncertainty in both data and inference.

The method has been developed and tested using EEG data collected under controlled auditory stimulation at 4.8, 16, and 40β€―Hz, with the aim of identifying functional coupling differences between typically developing children and those with reading difficulties.

If you use this method, please, cite our paper:

Diego Castillo-Barnes, AndrΓ©s Ortiz, Patricia Figueiredo, NicolΓ‘s J. Gallego-Molina.:"A Bayesian Framework for Phase-Amplitude Cross-Frequency Coupling Inference: Application to Reading Disability Detection". Expert Systems with Applications, 2025. https://doi.org/10.1016/j.eswa.2025.128510


πŸ“‚ Included Notebooks

BPAC_OneSubject.ipynb

This notebook performs the full analysis pipeline for a single subject:

  • Loads PAC values and time fragments.
  • Computes conditional probabilities using non-parametric Kernel Density Estimation (KDE).
  • Applies Bayesian inference to estimate directed PAC connections.
  • Outputs a subject-level probability matrix for directional connectivity.

BPAC_GroupsComparison.ipynb

This notebook takes individual probability matrices (from multiple subjects) and:

  • Compares connectivity patterns between two groups (e.g., controls vs. dyslexia).
  • Performs statistical testing (e.g., z-scores, permutation tests).
  • Outputs group-level summary figures and statistical results.

πŸ“Œ Why Jupyter Notebooks?

We chose Jupyter Notebooks to ensure transparency, reproducibility, and accessibility. This format allows users to:

  • Read and execute the analysis step-by-step.
  • Modify parameters interactively.
  • Visualize results directly within the workflow.

Researchers can adapt the pipeline to their own EEG datasets by editing and running the notebooks in any standard Python environment.


πŸš€ How to Run the Code

  1. Clone or download the repository:

    git clone https://github.com/BioSIP/BayesianPAC.git
  2. Create a Python environment with the following recommended packages:

    • numpy
    • scipy
    • pandas
    • matplotlib
    • seaborn
    • scikit-learn
    • statsmodels
    • jupyter
  3. Launch Jupyter:

    jupyter notebook
  4. Open and run one of the following notebooks:

    • BPAC_OneSubject.ipynb: to compute subject-level PAC connectivity.
    • BPAC_GroupsComparison.ipynb: to perform statistical comparisons between two groups.

πŸ“„ License

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).

You are free to:

  • Share β€” copy and redistribute the material in any medium or format.
  • Adapt β€” remix, transform, and build upon the material.

Under the following terms:

  • Attribution β€” You must give appropriate credit.
  • NonCommercial β€” You may not use the material for commercial purposes.

For full details, see the license description here:
https://creativecommons.org/licenses/by-nc/4.0/


πŸ‘₯ Authors & Contact

This repository is maintained by the BioSIP research group, University of MΓ‘laga.

If you have questions, comments, or would like to collaborate, please contact us at:
πŸ“§ www.biosip.uma.es

About

Bayesian estimation of Phase-Amplitude Coupling

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published