## Fitting the IF model using a genetic algorithm.

#### figure

Figures are generally photos, graphs and static images that would be represented in traditional pdf publications.

A genetic algorithm was used to find values for five parameters of the IF model that give an optimal fit to the reference data of Fig 1. **(A)** shows how a single run of the algorithm (128 parameter sets or ‘chromes’) converges over 20 generations. The left panel shows the five parameters, plotting the coefficient of variation (CV) for each parameter across the population. The right panel shows mean population fitness improving. The best fit parameters and fitness score (range 3.69 to 7.38) varied between runs. **(B)** shows that the values found for the half-life of the HAP (λ_{HAP}) are inversely related to the values found for the magnitude of the HAP (*k*_{HAP}), and that the values found for the half-life of the AHP (λ_{AHP}) are inversely related to the values found for the magnitude of the AHP (*k*_{AHP}): thus these parameters are not independent, but compensate against each other to some extent. (**C)** plots found parameters against relevant elements of the fit measure. The plots in C and D are colour coded by overall fit measure. Red shows the top 25%, green 25% to 50%, and blue the bottom 25%. The outliers tend to have poorer fit scores, whereas the red values are mostly clustered in a small range. To choose a single best fit we took the median value for parameters from the 10 best fits, shown by the white dots, which each fall within the red clusters. The final parameters (for the 9 spikes/s data) are *I*_{re} = 648 Hz, *k*_{HAP} = 83 mV, λ_{HAP} = 8 ms, *k*_{AHP} = 0.77, and λ_{AHP} = 482 ms.