"A method is presented for unravelling the demographic equation for structured populations. A solution to the McKendrick-von Foerster equation is constructed using spline functions and this is fitted to stage-structured population data in such a way that the solution is smooth, positive, and does not imply negative death rates. The smoothness of the surface, and hence the complexity of the population model, is determined in a statistically optimum manner using cross validation. Time- and age-dependent death rates can be obtained as well as time-dependent birth rates. Confidence intervals are obtained for population size and death rates that give a 95% probability that the true population dynamics are within the intervals. Practical application of the method is demonstrated, and comparison made with three alternative methods."