Supplement 1. The data and Mathematica codes used in the age-dependent survival analysis of Glanville fritillary butterflies.

<h2>File List</h2><blockquote> <table> <tbody><tr> <td><a href="survival_modelI.nb">survival_modelI.nb</a> – Mathematica code for model I of survival analysis</td> </tr> <tr> <td><a href="survival_modelII.nb">survival_modelII.nb</a> – Mathematica code for model II of survival analysis</td> </tr> <tr> <td><a href="individual_analysis.nb">individual_analysis.nb</a> – Mathematica code for the analysis of individual errors in death rates</td> </tr> <tr> <td><a href="MCMCAlgorithms.m">MCMCAlgorithms.m</a> – Mathematica package needed to run the above programs </td> </tr> <tr> <td><a href="MCMCAlgorithms.nb">MCMCAlgorithms.nb</a> – Used to generate MCMCAlgorithms.m</td> </tr> <tr> <td><a href="realdata.txt">realdata.txt</a> – Data <i>y</i> for each individual at each census</td> </tr> <tr> <td><a href="covariates.txt">covariates.txt</a> – Individual covariates</td> </tr> <tr> <td><a href="weather.txt">weather.txt</a> – Temperature at each census</td> </tr> <tr> <td><a href="jlast.txt">jlast.txt</a> – The last recapture census of each individual </td> </tr> <tr> <td><a href="femalemobility.txt">femalemobility.txt</a> – Mobility of females measured by the number of moves between different cells in the closed cage </td> </tr> <tr> <td><a href="readme.txt">readme.txt</a> – Description of the data files</td> </tr> <tr> <td><a href="all.zip">all.zip</a> – A zip of all files</td> </tr> </tbody></table> </blockquote><h2>Description</h2><blockquote> <p>The files survival_modelI.nb and survival_modelII.nb are Mathematica programs that can be used to estimate the parameters of the main model, and the file individual_analysis.nb performs the regressions relating to individual error terms. All the data files are described in readme.txt. </p> <p>Download all the files in the same directory. Change in the programs "workdirectory" to the current directory. The data files  realdata.txt, covariates.txt, weather.txt, and jlast.txt are needed to run the program survival_xxx.nb. Change the random seed to obtain different starting values. The posterior distributions are saved in the results_xxx.txt files. </p> <p>In the program individual_analysis.nb, the estimated distribution of individual errors is imported from the file individual_errors.txt. Set “infile” to femalemobility.txt if individual errors are regressed against the individual’s mobility. The posterior distribution is saved to the file "outfile".</p> </blockquote>