

.. _example_empdfestimation1d.py:



Density estimation
====================

This example shows how to do pdf estimation for one dimensional data. It
estimates a Gaussian mixture model for several number of components, and
it determines the "best" one according to the Bayesian Information
Criterion.

It uses old faitfhul waiting time as the one dimension data, and plots the best
model as well as the BIC as a function of the number of component.


**Source code:** :download:`pdfestimation1d.py <pdfestimation1d.py>`

.. literalinclude:: pdfestimation1d.py
    :lines: 14-
    