Script for data analysis accompanying the manuscript "Quantifying uncertainty due to fission–fusion dynamics as a component of social complexity" by Gabriel Ramos-Fernandez, Andrew J. King, Jacinta C. Beehner, Thore J. Bergman, Margaret C. Crofoot, Anthony Di Fiore, Julia Lehmann, Colleen M. Schaffner, Noah Snyder-Mackler, Klaus Zuberbühler, Filippo Aureli and Denis Boyer. Published on May 30th, 2018 in Proceedings of the Royal Society B series: Biological Sciences 285:20180532. https://doi.org/10.1098/rspb.2018.0532
The script calculates entropy of subgroup composition from the group and individual perspectives, including the observed and bootstrap entropies. It also compares both using the KL divergence and JS distance. Finally, the script calculates the probability of observing the group in partitions of different size.
Data used in the publication are available in https://doi.org/10.5061/dryad.51b68. The files should be placed in the same directory as the script.
If you use this script for academic research, please cite the paper mentioned above.