# popsynch (Quantifying Population Synchrony)
This Python module implements routines for computing a measure of population synchrony in compact metric spaces, as defined in [1].
Let $(M,d)$ be a compact metric space, and let $\pi \in \mathcal{P}(M)$ be a probability measure representing the distribution of a population over $M$.
Then the synchrony of $\pi$ is defined to be
$$
F(\pi) = 1 - \frac{1}{\nu_{(M,d)}} \inf_{\alpha \in M} \left(\int_{M} d(x,\alpha)^2 d\pi(x) \right)^{1/2},
$$
where the synchrony normalization constant
$$
\nu_{(M,d)} = \sup_{\mu \in \mathcal{P}(M)} \inf_{\alpha \in M} \left(\int_{M} d(x,\alpha)^2 d\mu(x) \right)^{1/2}.
$$
This module currently implements routines to compute the synchrony normalization constant of any finite metric space, and synchrony
of distributions on finite metric spaces, empirical distributions on the circle, and empirical distributions on rectangular parallelepipeds and compact balls
in Euclidean space.
## Installing popsynch
This module requires Python 3 (tested on Python>=3.12) and on [NumPy](https://numpy.org/) and [SciPy](https://scipy.org/), which will be automatically installed with popsynch.
This module can be installed using pip and a local clone of the associated repository
```
$ git clone git@gitlab.com:biochron/popsynch.git
$ cd popsynch
$ pip install .
```
or through the Python Package Index (PyPI):
```
$ pip install popsynch
```
## Examples
Jupyter notebooks that show the functionality of the methods in this module can be found in `examples/`.
The example notebooks additionally require
[Jupyter](https://jupyter.org/), [Pandas](https://pandas.pydata.org/), and [Matplotlib](https://matplotlib.org/), which can be installed with the command
```
$ pip install popsynch[notebooks]
```
## Author
* Francis C. Motta (fmotta@fau.edu)
## Citations
[1] Motta, F.C., McGoff, K., Cummins, B., Haase, S.B., (2024). Generalized Measures of Population Synchrony. (https://arxiv.org/abs/2406.15987)
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/biochron/popsynch",
"name": "popsynch",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "Synchrony, Synchronization, Frechet Variance, Wasserstein Distance, Optimal Transport",
"author": "Francis C. Motta",
"author_email": "fmotta@fau.edu",
"download_url": "https://files.pythonhosted.org/packages/7a/b1/58fe047df417e0a0482fe04815e3c3195edd3e1a10d15050e95e1b15addd/popsynch-0.4.tar.gz",
"platform": null,
"description": "# popsynch (Quantifying Population Synchrony)\r\n\r\nThis Python module implements routines for computing a measure of population synchrony in compact metric spaces, as defined in [1]. \r\nLet $(M,d)$ be a compact metric space, and let $\\pi \\in \\mathcal{P}(M)$ be a probability measure representing the distribution of a population over $M$. \r\nThen the synchrony of $\\pi$ is defined to be\r\n$$\r\nF(\\pi) = 1 - \\frac{1}{\\nu_{(M,d)}} \\inf_{\\alpha \\in M} \\left(\\int_{M} d(x,\\alpha)^2 d\\pi(x) \\right)^{1/2},\r\n$$\r\nwhere the synchrony normalization constant\r\n$$\r\n\\nu_{(M,d)} = \\sup_{\\mu \\in \\mathcal{P}(M)} \\inf_{\\alpha \\in M} \\left(\\int_{M} d(x,\\alpha)^2 d\\mu(x) \\right)^{1/2}.\r\n$$\r\n\r\nThis module currently implements routines to compute the synchrony normalization constant of any finite metric space, and synchrony\r\nof distributions on finite metric spaces, empirical distributions on the circle, and empirical distributions on rectangular parallelepipeds and compact balls \r\nin Euclidean space.\r\n\r\n## Installing popsynch\r\n\r\nThis module requires Python 3 (tested on Python>=3.12) and on [NumPy](https://numpy.org/) and [SciPy](https://scipy.org/), which will be automatically installed with popsynch.\r\n\r\nThis module can be installed using pip and a local clone of the associated repository\r\n```\r\n$ git clone git@gitlab.com:biochron/popsynch.git\r\n$ cd popsynch\r\n$ pip install .\r\n```\r\n\r\nor through the Python Package Index (PyPI):\r\n```\r\n$ pip install popsynch\r\n```\r\n\r\n## Examples\r\n\r\nJupyter notebooks that show the functionality of the methods in this module can be found in `examples/`.\r\n\r\nThe example notebooks additionally require \r\n[Jupyter](https://jupyter.org/), [Pandas](https://pandas.pydata.org/), and [Matplotlib](https://matplotlib.org/), which can be installed with the command\r\n```\r\n$ pip install popsynch[notebooks]\r\n```\r\n\r\n## Author\r\n\r\n* Francis C. Motta (fmotta@fau.edu)\r\n\r\n## Citations\r\n\r\n[1] Motta, F.C., McGoff, K., Cummins, B., Haase, S.B., (2024). Generalized Measures of Population Synchrony. (https://arxiv.org/abs/2406.15987)\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A pure Python package for computing the synchrony of population distributions in compact metric spaces.",
"version": "0.4",
"project_urls": {
"Download": "https://gitlab.com/biochron/popsynch/-/archive/1.0.0/popsynch-1.0.tar.gz",
"Homepage": "https://gitlab.com/biochron/popsynch"
},
"split_keywords": [
"synchrony",
" synchronization",
" frechet variance",
" wasserstein distance",
" optimal transport"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c72d7642665128b8a85bc322d9c145ff61c62521ffa845905b60695b6538dbf8",
"md5": "1971d646569d2a96440b3fec75d55eb5",
"sha256": "4482edfb818c651528cda904ece9bc10d17f8e0b2d7c61fcd7d3a7ccbca9f77a"
},
"downloads": -1,
"filename": "popsynch-0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1971d646569d2a96440b3fec75d55eb5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 8209,
"upload_time": "2024-12-03T21:49:53",
"upload_time_iso_8601": "2024-12-03T21:49:53.119886Z",
"url": "https://files.pythonhosted.org/packages/c7/2d/7642665128b8a85bc322d9c145ff61c62521ffa845905b60695b6538dbf8/popsynch-0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "7ab158fe047df417e0a0482fe04815e3c3195edd3e1a10d15050e95e1b15addd",
"md5": "2b06f26def6036e0ec7067c668a06609",
"sha256": "7b05cbf11ce65843ab32b573fcb329418192800f934186b986c25cb7f4a900ce"
},
"downloads": -1,
"filename": "popsynch-0.4.tar.gz",
"has_sig": false,
"md5_digest": "2b06f26def6036e0ec7067c668a06609",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 8506,
"upload_time": "2024-12-03T21:49:54",
"upload_time_iso_8601": "2024-12-03T21:49:54.674653Z",
"url": "https://files.pythonhosted.org/packages/7a/b1/58fe047df417e0a0482fe04815e3c3195edd3e1a10d15050e95e1b15addd/popsynch-0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-03 21:49:54",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "biochron",
"gitlab_project": "popsynch",
"lcname": "popsynch"
}