A method is described for optimizing models by linking simulation procedures with a non-linear regression programme. It is then possible to work towards a parsimonious model which contains those, and only those, variables required for an optimum fit. Using the observed values, and the predicted values from each simulation, the optimizing routine calculates the value of an appropriate loss function. It then makes small changes in the parameters governing the simulation, recalculates the predicted values and the first and second derivative of the loss function with respect to each parameter. The algorithm uses this information to minimize the loss function for a given formulation of the model. The model is improved by adding variables which can be shown statistically to improve the fit, and by removing those which do not. The use of the technique is illustrated with reference to a series of weekly estimates of the total numbers, births and survival probabilities of a population of male and female tsetse flies Glossina morsitans morsitans Westwood. Simulation involved following the lives of cohorts of flies, and of all their progeny, from the time they were deposited as larvae. Development and reproduction were regarded as fixed functions of temperature, but mortality rates of pupae and of adult flies depended on meteorological and biological variables, plus the level of trapping imposed on the population. Potential factors were added singly and the model thereby improved in an objective, stepwise manner. The best fit was achieved when effects on adult survival due to maximum temperature, various modes of trapping, and an annual cycle were included in the model. The optimized simulation technique has been used here in improving a model which describes a biological population but it could equally be used to improve models in any situation where data are fitted using simulation procedures.