  Estimating age distributions, or star formation histories, of stellar
populations in the Milky Way is important in order to study the evolution of
trends in elemental abundances and kinematics. We build on previous work to
develop an algorithm for estimating the age-metallicity distribution which uses
the full age-metallicity probability density functions (PDFs) of individual
stars. No assumptions are made about the shape of the underlying distribution,
and the only free parameter of the algorithm is used to ensure a smooth
solution. In this work we use individual age-metallicity PDFs from isochrone
fitting of stars with known metallicities. The method is tested with synthetic
samples and is found to recover the input age-metallicity distribution more
accurately than the distribution of individually estimated ages and
metallicities. The recovered sample age distribution is always more accurate
than the distribution of individual ages, also when restricted to the most
precise individual ages. By applying the method to the stars in the
Geneva-Copenhagen survey, we detect a possible minimum in the star formation
history of the Solar neighbourhood at an age of 10 Gyr which is not seen in the
distribution of individual ages. Although we apply the method only to
age-metallicity distributions, the algorithm is described more generally and
can in principle be applied in other parameter spaces. It is also not
restricted to individual parameter distributions from isochrone fitting,
meaning that a sample age distribution can be estimated based on individual age
PDFs from other methods such as asteroseismology or gyrochronology.
