View AA_BearKaganRand_master_file.m
% % % % % % % % % % % % % % % % % % % | |
% CODE FOR BEAR, KAGAN & RAND (2017) PROCB | |
% | |
% This MATLAB script runs the low mutation limit (steady state) calculations | |
% shown in Figures S1-S12 | |
% | |
% This script calls the following functions: | |
% | |
% calculate_payoff_YDYI(strategy1,strategy2,b,c,d,p,YD,YI) | |
% - returns the payoff of strategy1 against strategy2 given |
View tobit_vs_OLS_simulations.R
require(ggplot2) | |
require(GGally) | |
require(VGAM) | |
# Function to create a simulated data set and run models on it | |
oneRun <- function(number_of_obs,eff_IV1,eff_IV2,baseline,sd,lowerCutoff,upperCutoff,roundOn){ | |
# partition data into 4 conditions, specified by IV1 and IV2 | |
partition <- number_of_obs /4 | |
df <- expand.grid(IV1 = c(T,F), IV2 = c(T,F)) | |
df <- df[rep(row.names(df), partition), 1:2] |
View Templeton_Presentation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View AA_BearRand_master_file.m
% % % % % % % % % % % % % % % % % % % | |
% CODE FOR BEAR RAND (2016) PNAS | |
% | |
% This MATLAB script runs the low mutation limit (steady state) calculations | |
% shown in Figures 2a and S1-S3, as well as the agent-based simulations | |
% for higher mutation rates shown in Figure S3, and plots the results. | |
% | |
% This script calls the following functions: | |
% | |
% calculate_payoff(strategy1,strategy2,b,c,d,p) |