  Bayesian model comparison frameworks can be used when fitting models to data
in order to infer the appropriate model complexity in a data-driven manner. We
aim to use them to detect the correct number of major episodes of star
formation from the analysis of the spectral energy distributions (SEDs) of
galaxies, modeled after 3D-HST galaxies at z ~ 1. Starting from the published
stellar population properties of these galaxies, we use kernel density
estimates to build multivariate input parameter distributions to obtain
realistic simulations. We create simulated sets of spectra of varying degrees
of complexity (identified by the number of parameters), and derive SED fitting
results and evidences for pairs of nested models, including the correct model
as well as more simplistic ones, using the BAGPIPES codebase with nested
sampling algorithm MultiNest. We then ask the question: is it true - as
expected in Bayesian model comparison frameworks - that the correct model has
larger evidence?}
  Our results indicate that the ratio of evidences (the Bayes factor) is able
to identify the correct underlying model in the vast majority of cases. The
quality of the results improves primarily as a function of the total S/N in the
SED. We also compare the Bayes factors obtained using the evidence to those
obtained via the Savage-Dickey Density Ratio (SDDR), an analytic approximation
which can be calculated using samples from regular Markov Chain Monte Carlo
methods. We show that the SDDR ratio can satisfactorily replace a full evidence
calculation provided that the sampling density is sufficient.
