denoising.inverse_transform_sampling

But: construire une distribution à partir d’un modèle empirique (“inverse transform sampling”).

Implémentation en Python: * http://www.astroml.org/book_figures/chapter3/fig_clone_distribution.html * https://github.com/astroML/astroML/blob/master/astroML/density_estimation/empirical.py * https://github.com/astroML/astroML/blob/0287fe00c429b28b3ddf52435a32543f43246349/astroML/density_estimation/tests/test_empirical.py * http://www.astroml.org/modules/generated/astroML.density_estimation.EmpiricalDistribution.html#astroML.density_estimation.EmpiricalDistribution * https://docs.scipy.org/doc/scipy/reference/generated/scipy.interpolate.splprep.html * https://docs.scipy.org/doc/scipy/reference/interpolate.html * https://en.wikipedia.org/wiki/Inverse_transform_sampling

Mon implémentation: * Ne pas garder tous les points comme ils le font dans astroml (j’ai plusieurs centaines de millions se samples…) * A la place, utiliser np.histogram pour faire un CDF avec un nombre de bins choisi * Stocker ce CDF dans un fichier * Ecrire une classe pour générer des echantillons: charger et interpoller (avec des splines) le CDF dans __init__: interpolate.splrep(y, data) * Fonction rvs qui génère un echantillon: interpolate.splev(y, self._tck)