DOI: 10.5061/dryad.7d7wm384b
title: Data from: Exploring the Importance of Stochasticity to Hybrid Equilibria in a Discrete Signaling Game

description: Communication via evolved signals is ubiquitous (both within and between
 species) in the natural world. However, how honest we should expect
 signals to be remains an open question. Hybrid equilibria are a form of
 equilibria predicted by discrete signaling games in which signalers are
 sometimes dishonest and signals do not completely reliably convey
 information on signaler quality. While these equilibria have been
 theoretically demonstrated in several signaling games, their dynamics in a
 stochastic simulation of evolutionary trajectories (that include
 representation of the inherent noise expected in evolution in the natural
 world) have not previously been studied. In this paper, we present an
 agent-based simulation of a discrete signaling game which exhibits hybrid
 equilibria. We find that while hybrid equilibria are evolutionarily
 attractive where they exist, populations exhibit vairable and often
 drastic oscillating behavior around the predicted equilibrium values. We
 discuss how these dynamics might offer valuable opportunity for detecting
 hybrid equilibria in natural populations.
description: Included in this repository: Data
 from agent-based simulations. Code for simulations
 presented in the paper.
description: # Raw data for Exploring the Importance of Stochasticity to Hybrid
 Equilibria in a Discrete Signaling Game [Access this dataset on
 Dryad](https://doi.org/10.5061/dryad.7d7wm384b) This dataset contains
 results of simulations of a discrete signaling game. Results for two main
 experiments are given. One experiment allowed agents to play the
 signalling game starting at a nonsignaling or honest signaling state in
 order to determine which equilibria they reach after 1,000,000
 generations. The other experiment focuses on trajectories of these
 simulations, studying how differential mutation rates for senders and
 receivers affects oscillations in strategies through time. ## Description
 of the data and file structure (in Data.zip) ### Equilibria\_Honest Start
 and Equilibria\_No Signaling Start folders: These folder contain raw data
 for simulations used to make figure 3 in the manuscript and supplementary
 figures 1-2. Simulations initialized at an honest signaling state
 (Equilibria_Honest Start folder) or a no signaling state (Equilibrai_No
 Signaling Start folder). The `*_equilibs.csv` files give the equilibrium
 reached by each simulation, calculated using the tolerance value in the
 file name (eg 0.01). **Differential mutation rates**: This folder contains
 raw data for simulations with different mutation rates and sizes (used to
 make figure 6 in the manuscript and supplementary figures 3-6). In all
 folders: * `*params_json` files are used as inputs when running
 simulations * `*summaryStats_Exper...* `files store average values of
 strategy variables every 100 generations for a single simulation *
 `summaryStats.csv` stores summarized data for all simulations in this
 folder The numerical suffix to each file name corresponds across summary
 stat, parameter, and trajectory files. Structure of data files: Summary
 stats files (raw): `[numerical code]_summaryStats_[name of
 experiment].csv` Each summaryStats file records population mean values
 every 100 generations for one replicate of a simulation These summary
 statistics are computed and exported by the C++ simulaiton. They are used
 to track how strategies evolve through time and which equilibria are
 reached. These files are used to show population trajectories through time
 (eg Figure 5). These files are combined and collated into the
 summaryStats.csv files to produce figures concering evolved population
 strategies (eg figure 3). Variables in these data (columns of the .csv)
 are as follows: * "rep": Used if one file stores data for
 multiple replicates * "gen": Generation which this row shows
 data for * "indType": Does this row show data for senders or
 receivers? * "strat01": Average population value for s01 or r01
 at this generation (depending on value in indType; s01 if
 'Sender' and r01 if 'Receiver' shown in indType) *
 "strat11": Average population value for s11 or r11 at this
 generation (depending on indType) * "meanFit": Average fitness
 of senders or reveivers at this generation (depending on indType) *
 "expAlphaBeta": Expected value of alpha or beta (depending on
 indType) for a hybrid or honest equilibrium (whichever is predicted
 analytically for the parameters) * "seed": User-input seed for
 random number generator * "N": User-input number of signalers
 and receivers * "G": User-input number of generations to run
 simiulations for * "c1": User-input cost to consonant
 individuals ('c1' in paper) * "c2": User-input cost to
 dissonant individuals ('c0' in paper) * "v1":
 User-input benefit to consonant individuals (1 in paper) * "v2":
 User-input benefit to dissonant individuals (1 in paper) * "w1":
 User-input receiver benefit - play r = 1 to q = 1 * "w2":
 User-input receiver benefit - play r = 0 to q = 1 * "w3":
 User-input receiver benefit - play r = 0 to q = 1 * "w4":
 User-input receiver benefit - play r = 0 to q = 0 * "m":
 User-input percent of consonant signalers * "mCorrected": Actual
 percent of consonant signalers in population (considers deviations from m
 due to integer number of consonant individuals) *
 "interactionPartners": User-input number of individuals each
 sender and receiver plays the signaling game with * "mutRateS":
 User-input mutation rate for sender strategies (s01, s11) *
 "mutStepS": User-input mutation size for sender strategies (s01,
 s11) * "mutRateR": User-input mutation rate for receiver
 strategies (r01, r11) * "mutStepR": User-input mutation size for
 receivers strategies (r01, r11) * "init01": User-input initial
 value for s01 or r01 (depending on indType) * "init11":
 User-input initial value for s11 or r11 (depending on indType) *
 "replicates": User-input number of replicates this data depicts
 * "cauchyDist": User-input boolean value for whether a cauchy or
 normal distriubtion is used for mutations. 0 normal, 1 cauchy Summary
 stats file (combined): '`summaryStats.csv`' Only for the
 'Differential mutations rates' experiments This is a file
 combining some data from all individual raw summaryStats files (which each
 hold data for one simulation) for an experiment. It shows the mean values
 of the final 200 000 generations of each raw summaryStat file. Variables
 in these data (columns of the .csv) are as follows: * "it": A
 number giving a unique identifying integer to each row * "rep":
 Not relevant for this file: ignore * "gen": Not relevant for
 this file: ignore * "indType": Not relevant for this file:
 ignore * "strat01": Not relevant for this file: ignore *
 "strat11": Not relevant for this file: ignore *
 "meanFit": Average population fitness over *
 "expAlphaBeta": See above * "seed": User input
 parameter, see above * "N": User input parameter, see above *
 "G": User input parameter, see above * "c1": User
 input parameter, see above * "c2": User input parameter, see
 above * "v1": User input parameter, see above * "v2":
 User input parameter, see above * "w1": User input parameter,
 see above * "w2": User input parameter, see above *
 "w3": User input parameter, see above * "w4": User
 input parameter, see above * "m": User input parameter, see
 above * "mCorrected": See above *
 "interactionPartners": User input parameter, see above *
 "mutRateS": User input parameter, see above *
 "mutStepS": User input parameter, see above *
 "mutRateR": User input parameter, see above *
 "mutStepR": User input parameter, see above *
 "init01": User input parameter, see above * "init11":
 User input parameter, see above * "replicates": User input
 parameter, see above * "cauchyDist": User input parameter, see
 above * "fileName": Raw data file which this row shows holds
 data from * "ss01_mean": Average s01 value over the last 200 000
 generations of the raw data file referred to in fileName *
 "ss01_sd": Standard deviation of s01 values over the last 200
 000 generations of the raw data * "ss01_var": Variance of s01
 values over the last 200 000 generations of the raw data *
 "ss01_max": Maximum s01 value in the last 200 000 generations of
 the raw data * "ss01_min": Minimum s01 value in the last 200 000
 generations of the raw data * "ss11_mean": Same as above, but
 for s11 * "ss11_sd": Same as above, but for s11 *
 "ss11_var": Same as above, but for s11 * "ss11_max":
 Same as above, but for s11 * "ss11_min": Same as above, but for
 s11 * "rs01_mean": Same as above, but for r01 *
 "rs01_sd": Same as above, but for r01 * "rs01_var":
 Same as above, but for r01 * "rs01_max": Same as above, but for
 r01 * "rs01_min": Same as above, but for r01 *
 "rs11_mean": Same as above, but for r11 * "rs11_sd":
 Same as above, but for r11 * "rs11_var": Same as above, but for
 r11 * "rs11_max": Same as above, but for r11 *
 "rs11_min": Same as above, but for r11 *
 "ss01_amp_mean": Not used in analyses. This is an attempt to
 capture the size of oscillations around a hybrid equilibrium. It shows the
 average difference betwen the maximum and minimum values of s01 in an
 oscialltion * "ss01_amp_sd": Not used in analyses. This shows
 the standard deviation of amplitude of oscialltions of s01 around a hybrid
 equilibrium * "ss01_halfPer_mean": Not used in analyses. This
 shows half the period between peaks in oscialltions of s01 around a hybrid
 equilirim * "ss01_halfPer_sd": Not used in analyses. This shows
 the standard deviation of the above. Parameter files: `[experiment
 name]_[integer]_params.json` These text files hold input parameters which
 were used to run simulations. See description of these files under
 ##Code/Software below. Summary files for equilibrium experiments:
 `_endDataAll_11_noSig.csv and _endDataAll_11_honest.csv` Only for
 'Equilibria_no signaling start' and 'Equilibria\_ honest
 start' experiments These files have the same function as
 summaryStats.csv: they hold calculated average values over the last 200
 000 generations of the raw data files. There is one .csv for all
 simulations with an honest start and and another for all simulations with
 a no signaling start Variables in these data (columns of the .csv) are as
 follows: * "rep": Replicate of the raw data file in fileName
 which this row holds data for * "gen": unused *
 "indType": unused * "strat01": unused *
 "strat11": unused * "meanFit": unused *
 "expAlphaBeta": unused * "seed": User input parameter,
 see above * "N": User input parameter, see above *
 "G": User input parameter, see above * "c1": User
 input parameter, see above * "c2": User input parameter, see
 above * "v1": User input parameter, see above * "v2":
 User input parameter, see above * "w1": User input parameter,
 see above * "w2": User input parameter, see above *
 "w3": User input parameter, see above * "w4" User
 input parameter, see above * "m": User input parameter, see
 above * "mCorrected": See above *
 "interactionPartners": User input parameter, see above *
 "mutRate": Mutation rate for both sender and receiver strategies
 (s01, s11, r01, and r11) * "mutStep": Mutation size for both
 sender and receiver strategies * "init01": Initial s01 and r01,
 determining whether the simulation is an honest start or no signaling
 start. * "init11": Initial s11 and r11, determining whether the
 simulation is an honest start or no signaling start. *
 "replicates": User input parameter, see above *
 "cauchyDist": User input parameter, see above *
 "fileName": Raw data file this row holds collated data for *
 "expAlpha": Expected value of alpha for a pooling, hybrid, or
 honest equilibrium (whichever is predicted analytically for the
 parameters, priority given to nonpooling equilibria) *
 "expBeta": Expected value of beta for a pooling, hybrid, or
 honest equilibrium (whichever is predicted analytically for the
 parameters) * "mean_S01": Average value of s01 for the last 200
 000 generations of this simulation * "mean_S11": Average value
 of s11 for the last 200 000 generations of this simulation *
 "mean_R01": Average value of r01 for the last 200 000
 generations of this simulation * "mean_R11": Average value of
 r11 for the last 200 000 generations of this simulation *
 "fileSuffix": Part of the file name used by some R scripts *
 "fileNum": Used to associated different rows showing different
 replicates in the same raw data file Equilibrium files:
 `[tolerance]_equilibs.csv` Only for 'Equilibria_no signaling
 start' and 'Equilibria\_ honest start' experiments These
 files hold, for each raw data file, the equilibrium reached after 1 000
 000 generations of evolution. This is calculated by taking mean population
 strategy values over the last 200 000 generations of evolution and
 comparing them to expected values for pooling, hybrid, and honest
 equilibria. If the values are within a percentage (tolerance) of the
 expected values, the simulation is said to have reached that equilibrium
 Tolerances used are given at the beginning of the file name: 0.01, 0.02,
 0.03, 0.04, 0.05, and 0.1 were used All columns are the same as for
 endDataAll files above, except for the last 8: * "alpha": The
 actual mean alpha (s01) value for the last 200 000 generations of the
 simulation * "devAlpha": Deviation of actual alpha from expected
 * "expAlphaFix": Expected alpha value at a honest or hybrid
 equiulibirum (whichever is predicted analytically), or pooling if neither
 hybrid or honest is predicted. The 'fix' accounts for negative
 costs or costs greater that 1, which caused the original calculation to be
 incorrect * "expBetaFix": Expected beta value at a honest or
 hybrid equiulibirum (whichever is predicted analytically), or pooling if
 neither hybrid or honest is predicted. The 'fix' accounts for
 negative costs or costs greater that 1, which caused the original
 calculation to be incorrect * "beta": The actual mean beta (r11)
 value for the last 200 000 generations of the simulation *
 "devBeta": Deviation of actual beta from expected *
 "equilibrium": The equilibrium the data is determined to have
 reached if it is within [tolerance] percent of the expected values.
 "Hybrid, strong" means that the data is within [tolerance] of
 the expcted alpha and beta for a hybird equilibrium with that combination
 of m, c1, and c0. 'Honest' means that the population is within
 [tolerance] of an honest signaling state. [Pooling] means the population
 is within [tolerance] percent of a nonsignaling state.
 'Undefined' is assigned if none of the aforementioned apply. *
 "tol": Tolerance used for equilibrium calculations in this file.
 ## Sharing/Access information This is data for "Exploring the
 Importance of Stochasticity to Hybrid Equilibria in a Discrete Signaling
 Game" by Jacob Chisausky, Kevin Zollman, and Graeme Ruxton (2024).
 Published in the Journal of Evolutionary Biology Jacob Chisausky is
 responsible for writing code and analyzing data - email him with questions
 at [jacob.chisausky@princeton.edu](mailto:jacob.chisausky@princeton.edu)
 ## Code/Software. Code is uploaded in this repository (in
 Code_for_agent_based_signaling_model.zip) CreateBat_SignallingModel_v1.R
 This is an R script in takes user-entered parameter values and creates a
 folder with Parameter.json files as well as a bash script to run the jobs
 in sequence The user can input a vector of values and parameter json files
 are written with all parameter combinations: this allows easy testing of
 questions For instance, one could enter N &lt;- (100,1000,1000) and
 mutRateAlpha &lt;- (0.01,0.001) and 6 files will be created, with each
 combination of N and mutRateAlpha DataAnalysis.R This is an R script which
 creates a graph of the trajectory of a single replicate, for now. It shows
 strategy frequencies and alpha and beta through time for a selected
 simulation rScriptTest_Parameters.json This is an example .json file which
 shows the format that .json files need to be to be read by the cpp program
 # Agent-based-signaling-game Agent-based model for "Exploring the
 Importance of Stochasticity to Hybrid Equilibria in a Discrete Signaling
 Game" Chisausky Zollman & Ruxton 2024 How to run this code on
 Windows: Download all files. Edit the 'example_params.json" file
 to your desired combination of parameters. In the command line, run
 "signalling_model.exe example_params.json". Data will be written
 to .csv files in the folder containing the executable. A description of
 parameters is as follows (with values for example): "seed":
 16570320, ----------------- Seed for random number generator
 "N": 1000, ------------------------ Number of signalers and
 receivers "G": 1000, ------------------------ Number of
 generations "c1": 0.1, ------------------------ Cost to
 consonant individuals ('c1' in paper) "c2": 0.5,
 ------------------------ Cost to dissonant individuals ('c0' in
 paper) "v1": 1, -------------------------- Benefit to consonant
 individuals (1 in paper) "v2": 1, --------------------------
 Benefit to dissonant individuals (1 in paper) "w1": 1,
 -------------------------- Receiver benefit - play r = 1 to q = 1
 "w2": 0, -------------------------- Receiver benefit - play r =
 0 to q = 1 "w3": 0, -------------------------- Receiver benefit
 - play r = 0 to q = 1 "w4": 1, --------------------------
 Receiver benefit - play r = 0 to q = 0 "m": 0.333333333333333,
 ----------- Fraction of individuals that are consonant
 "interactionPartners": 10, -------- How many games are played
 against different partners per individual per generation?
 "mutRateS": 0.001, ---------------- Mutation rate for signaler
 strategies "mutStepS": 0.01, ----------------- Mutation size for
 signaler strategies "mutRateR": 0.001, ---------------- Mutation
 rate for receiver strategies "mutStepR": 0.01, -----------------
 Mutation size for receiver strategies "cauchyDist": false,
 -------------- Use a cauchy distribution rather than normal for mutations?
 "initS01": 0.5, ------------------- Initial value for s01 for
 all iundividuals "initS11": 1, --------------------- Initial
 value for s11 for all iundividuals "initR01": 0,
 --------------------- Initial value for r01 for all iundividuals
 "initR11": 0.5, ------------------- Initial value for r11 for
 all iundividuals "replicates": 10, ------------------ How many
 replicates to run? "reportFreq": 100, ---------------- How many
 times to export data during the simulation? "dataFileName":
 "Local_test", ----- This will be part of the file name for .csv
 files "dataFileFolder": ".", ------------ Where to
 save data. Leave this as "." to save data in same folder as
 executable "computeMeansInCpp": true --------- If false, export
 data for all individuals without calculating means.