Skip to main content

A pure Python package for computing the synchrony of population distributions in compact metric spaces.

Project description

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 and empirical distributions on the circle.

Installing popsynch

This module requires Python 3 (tested on Python>=3.12) and on NumPy and SciPy, 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, Pandas, and Matplotlib, which can be installed with the command

$ pip install popsynch[notebooks]

Author

Citations

[1] Motta, F.C., McGoff, K., Cummins, B., Haase, S.B., (2024). Generalized Measures of Population Synchrony. (https://arxiv.org/abs/2406.15987)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

popsynch-0.3.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

popsynch-0.3-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file popsynch-0.3.tar.gz.

File metadata

  • Download URL: popsynch-0.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for popsynch-0.3.tar.gz
Algorithm Hash digest
SHA256 c9b47aa81dac6ded4ffffbb920598c5ea0cfd3142f84bae0d0ee21d093177c23
MD5 94150a73883ee1c62a314ca953be8fdc
BLAKE2b-256 2a59fbbaf2abbc8db3a7afb698412b938ce810e9f5577fa260d6390daacd35a4

See more details on using hashes here.

File details

Details for the file popsynch-0.3-py3-none-any.whl.

File metadata

  • Download URL: popsynch-0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.1

File hashes

Hashes for popsynch-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e4abbf024dd6cd6e8469d4c92a4f4143ebe88bee68f721fce83934531399392b
MD5 c8f33a36a2708835a27be7408cfea317
BLAKE2b-256 d41b81885559584f31add4ee367d6e74d215da1c96459a85b64f5c27776b84ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page