  Recent studies based on the integrated light of distant galaxies suggest that
the initial mass function (IMF) might not be universal. Variations of the IMF
with galaxy type and/or formation time may have important consequences for our
understanding of galaxy evolution. We have developed a new stellar population
synthesis (SPS) code specifically designed to reconstruct the IMF. We implement
a novel approach combining regularization with hierarchical Bayesian inference.
Within this approach we use a parametrized IMF prior to regulate a direct
inference of the IMF. This direct inference gives more freedom to the IMF and
allows the model to deviate from parametrized models when demanded by the data.
We use Markov Chain Monte Carlo sampling techniques to reconstruct the best
parameters for the IMF prior, the age, and the metallicity of a single stellar
population. We present our code and apply our model to a number of mock single
stellar populations with different ages, metallicities, and IMFs. When
systematic uncertainties are not significant, we are able to reconstruct the
input parameters that were used to create the mock populations. Our results
show that if systematic uncertainties do play a role, this may introduce a bias
on the results. Therefore, it is important to objectively compare different
ingredients of SPS models. Through its Bayesian framework, our model is
well-suited for this.
