indii/ml/aux/GaussianMixturePdf.hpp

00001 #ifndef INDII_ML_AUX_GAUSSIANMIXTUREPDF_HPP
00002 #define INDII_ML_AUX_GAUSSIANMIXTUREPDF_HPP
00003 
00004 #include "StandardMixturePdf.hpp"
00005 #include "GaussianPdf.hpp"
00006 #include "DiracMixturePdf.hpp"
00007 
00008 namespace indii {
00009   namespace ml {
00010     namespace aux {
00011 /**
00012  * Gaussian mixture probability density.
00013  *
00014  * @author Lawrence Murray <lawrence@indii.org>
00015  * @version $Rev: 556 $
00016  * @date $Date: 2008-09-04 18:02:20 +0100 (Thu, 04 Sep 2008) $
00017  *
00018  * @see MixturePdf for more information regarding the serialization
00019  * and parallelisation features of this class.
00020  */
00021 class GaussianMixturePdf : public StandardMixturePdf<GaussianPdf> {
00022 public:
00023   /**
00024    * Default constructor.
00025    *
00026    * Initialises the mixture with zero dimensions. This should
00027    * generally only be used when the object is to be restored from a
00028    * serialization. Indeed, there is no other way to resize the
00029    * mixture to nonzero dimensionality except by subsequently
00030    * restoring from a serialization.
00031    */
00032   GaussianMixturePdf();
00033 
00034   /**
00035    * Constructor. One or more components should be added with
00036    * addComponent() after construction.
00037    *
00038    * @param N Dimensionality of the distribution.
00039    */
00040   GaussianMixturePdf(const unsigned int N);
00041 
00042   /**
00043    * Constructor.
00044    *
00045    * @param K Number of Gaussian components.
00046    * @param p Weighted sample set.
00047    *
00048    * A @p K component Gaussian mixture is fit to @p p using Expectation-
00049    * Maximisation (EM) with random initialisation.
00050    *
00051    * @todo This has not been tested thoroughly.
00052    */
00053   GaussianMixturePdf(const unsigned int K, const DiracMixturePdf& p);
00054 
00055   /**
00056    * Destructor.
00057    */
00058   virtual ~GaussianMixturePdf();
00059 
00060 private:
00061   /**
00062    * Serialize or restore from serialization.
00063    */
00064   template<class Archive>
00065   void serialize(Archive& ar, const unsigned int version);
00066 
00067   /*
00068    * Boost.Serialization requirements.
00069    */
00070   friend class boost::serialization::access;
00071 
00072 };
00073 
00074     }
00075   }
00076 }
00077 
00078 #include "boost/serialization/base_object.hpp"
00079 
00080 template <class Archive>
00081 void indii::ml::aux::GaussianMixturePdf::serialize(Archive& ar,
00082     const unsigned int version) {
00083   ar & boost::serialization::base_object<
00084       indii::ml::aux::StandardMixturePdf<indii::ml::aux::GaussianPdf> >(
00085       *this);
00086 }
00087 
00088 #endif
00089 

Generated on Wed Dec 17 15:11:57 2008 for dysii Dynamical Systems Library by  doxygen 1.5.3