Index: library/bdm/stat/exp_family.h
===================================================================
--- library/bdm/stat/exp_family.h (revision 1064)
+++ library/bdm/stat/exp_family.h (revision 1066)
@@ -36,5 +36,5 @@
 class eEF : public epdf {
 public:
-//	eEF() :epdf() {};
+//    eEF() :epdf() {};
     //! default constructor
     eEF () : epdf () {};
@@ -216,5 +216,5 @@
         return R.to_mat();
     }
-    //	mlnorm<sq_T>* condition ( const RV &rvn ) const ; <=========== fails to cmpile. Why?
+    //    mlnorm<sq_T>* condition ( const RV &rvn ) const ; <=========== fails to cmpile. Why?
     shared_ptr<pdf> condition ( const RV &rvn ) const;
 
@@ -450,19 +450,26 @@
     }
 
-    /*! Create Gauss-inverse-Wishart density
-    \f[ f(rv) = GiW(V,\nu) \f]
-    from structure
+    /*! Create object from the following structure
     \code
+
     class = 'egiw';
-    V.L     = [];             // L part of matrix V
-    V.D     = [];             // D part of matrix V
-    -or- V  = []              // full matrix V
-    -or- dV = [];               // vector of diagonal of V (when V not given)
-    nu      = [];               // scalar \nu ((almost) degrees of freedom)
-    						  // when missing, it will be computed to obtain proper pdf
-    dimx    = [];               // dimension of the wishart part
-    rv = RV({'name'})         // description of RV
-    rvc = RV({'name'})        // description of RV in condition
+    dimx    = [...];       % dimension of the wishart part
+    V.L     = [...];       % L part of matrix V
+    V.D     = [...];       % D part of matrix V
+    -or- V  = [...];       % full matrix V
+    -or- dV = [...];       % vector of diagonal of V (when V not given)
+
+    rv = RV({'names',...},[sizes,...],[times,...]);   % description of RV
+    rvc = RV({'names',...},[sizes,...],[times,...]);  % description of RV in condition
+
+    --- optional fields ---
+    nu      = [];             % scalar \nu ((almost) degrees of freedom)
+    --- inherited fields ---
+    bdm::eEF::from_setting
     \endcode
+
+    fulfilling formula \f[ f(rv) = GiW(V,\nu) \f]
+
+    If \nu is not given, it will be computed to obtain proper pdf.
 
     \sa log_level_enums
@@ -696,5 +703,5 @@
     */
     void from_setting ( const Setting &set );
-    void 	to_setting  (Setting  &set) const;
+    void     to_setting  (Setting  &set) const;
     void validate();
 };
@@ -855,6 +862,6 @@
     \code
     class = 'egamma';
-    alpha = [...];         % vector of alpha
-    beta = [...];          % vector of beta
+    alpha = [...];         % vector alpha
+    beta = [...];          % vector beta
     --- inherited fields ---
     bdm::eEF::from_setting
@@ -910,12 +917,12 @@
 class emix : public epdf {
 protected:
-	int n;
-	vec &w;
-	Array<epdf*> Coms;
+    int n;
+    vec &w;
+    Array<epdf*> Coms;
 public:
 //! Default constructor
-	emix ( const RV &rv, vec &w0): epdf(rv), n(w0.length()), w(w0), Coms(n) {};
-	void set_parameters( int &i, double wi, epdf* ep){w(i)=wi;Coms(i)=ep;}
-	vec mean(){vec pom; for(int i=0;i<n;i++){pom+=Coms(i)->mean()*w(i);} return pom;};
+    emix ( const RV &rv, vec &w0): epdf(rv), n(w0.length()), w(w0), Coms(n) {};
+    void set_parameters( int &i, double wi, epdf* ep){w(i)=wi;Coms(i)=ep;}
+    vec mean(){vec pom; for(int i=0;i<n;i++){pom+=Coms(i)->mean()*w(i);} return pom;};
 };
 */
@@ -980,5 +987,5 @@
      */
     void from_setting ( const Setting &set );
-    void 	to_setting  (Setting  &set) const;
+    void     to_setting  (Setting  &set) const;
     void validate();
 };
@@ -1003,5 +1010,5 @@
         iepdf.set_parameters ( -delta, delta );
     }
-    void 	to_setting  (Setting  &set) const {
+    void     to_setting  (Setting  &set) const {
         pdf::to_setting ( set );
         UI::save( iepdf.mean(), set, "delta");
@@ -1028,5 +1035,5 @@
     //! Constant additive term
     vec mu_const;
-//			vec& _mu; //cached epdf.mu; !!!!!! WHY NOT?
+//            vec& _mu; //cached epdf.mu; !!!!!! WHY NOT?
 public:
     //! \name Constructors
@@ -1128,5 +1135,5 @@
 class mgnorm : public pdf_internal< enorm< sq_T > > {
 private:
-//			vec &mu; WHY NOT?
+//            vec &mu; WHY NOT?
     shared_ptr<fnc> g;
 
@@ -1148,6 +1155,6 @@
 
     R = [1, 0;             // covariance matrix
-    	0, 1];
-    	--OR --
+        0, 1];
+        --OR --
     dR = [1, 1];           // diagonal of cavariance matrix
 
@@ -1214,5 +1221,5 @@
 public:
     mlstudent () : mlnorm<ldmat, enorm> (),
-        Lambda (),	_R ( iepdf._R() ) {}
+        Lambda (),    _R ( iepdf._R() ) {}
     //! constructor function
     void set_parameters ( const mat &A0, const vec &mu0, const ldmat &R0, const ldmat& Lambda0 ) {
@@ -1276,5 +1283,5 @@
     */
     void from_setting ( const Setting &set );
-    void 	to_setting  (Setting  &set) const;
+    void     to_setting  (Setting  &set) const;
     void validate();
 };
@@ -1324,5 +1331,5 @@
     };
 
-    void 	validate () {
+    void     validate () {
         pdf_internal<eigamma>::validate();
         dimc = dimension();
@@ -1362,5 +1369,5 @@
     };
 
-    void 	validate () {
+    void     validate () {
         mgamma::validate();
         dimc = dimension();
@@ -1607,5 +1614,5 @@
     }
 
-    virtual void 	validate () {
+    virtual void     validate () {
         epdf::validate();
         W.validate();
@@ -1637,5 +1644,5 @@
         X.inv ( iX );
         // compute
-// 				\frac{ |\Psi|^{m/2}|X|^{-(m+p+1)/2}e^{-tr(\Psi X^{-1})/2} }{ 2^{mp/2}\Gamma_p(m/2)},
+//                 \frac{ |\Psi|^{m/2}|X|^{-(m+p+1)/2}e^{-tr(\Psi X^{-1})/2} }{ 2^{mp/2}\Gamma_p(m/2)},
         mat M = Y.to_mat() * iX.to_mat();
 
@@ -1643,11 +1650,11 @@
         //Fixme! Multivariate gamma omitted!! it is ok for sampling, but not otherwise!!
 
-        /*				if (0) {
-        					mat XX=X.to_mat();
-        					mat YY=Y.to_mat();
-
-        					double log2 = 0.5*p*log(det(YY))-0.5*(delta+p+1)*log(det(XX))-0.5*trace(YY*inv(XX));
-        					cout << log1 << "," << log2 << endl;
-        				}*/
+        /*                if (0) {
+                            mat XX=X.to_mat();
+                            mat YY=Y.to_mat();
+
+                            double log2 = 0.5*p*log(det(YY))-0.5*(delta+p+1)*log(det(XX))-0.5*trace(YY*inv(XX));
+                            cout << log1 << "," << log2 << endl;
+                        }*/
         return log1;
     };
@@ -1746,5 +1753,5 @@
         samples = Av;
     };
-    virtual void 	validate ();
+    virtual void     validate ();
     //! Potentially dangerous, use with care.
     vec& _w()  {
@@ -1799,6 +1806,6 @@
     \code
     class = 'eEmp';
-    samples = [...];               % array of samples
-    w = [...];					   % weights of samples stored in vector
+    samples = [...];  % array of samples
+    w = [...];        % weights of samples stored in vector
     --- inherited fields ---
     bdm::epdf::from_setting
@@ -1853,5 +1860,5 @@
 // template<class sq_T>
 // void enorm<sq_T>::tupdate ( double phi, mat &vbar, double nubar ) {
-// 	//
+//     //
 // };
 
@@ -1869,8 +1876,8 @@
 // template<class sq_T>
 // double enorm<sq_T>::eval ( const vec &val ) const {
-// 	double pdfl,e;
-// 	pdfl = evallog ( val );
-// 	e = exp ( pdfl );
-// 	return e;
+//     double pdfl,e;
+//     pdfl = evallog ( val );
+//     e = exp ( pdfl );
+//     return e;
 // };
 
@@ -1892,25 +1899,25 @@
 // template<class sq_T>
 // vec mlnorm<sq_T>::samplecond (const  vec &cond, double &lik ) {
-// 	this->condition ( cond );
-// 	vec smp = epdf.sample();
-// 	lik = epdf.eval ( smp );
-// 	return smp;
+//     this->condition ( cond );
+//     vec smp = epdf.sample();
+//     lik = epdf.eval ( smp );
+//     return smp;
 // }
 
 // template<class sq_T>
 // mat mlnorm<sq_T>::samplecond (const vec &cond, vec &lik, int n ) {
-// 	int i;
-// 	int dim = rv.count();
-// 	mat Smp ( dim,n );
-// 	vec smp ( dim );
-// 	this->condition ( cond );
+//     int i;
+//     int dim = rv.count();
+//     mat Smp ( dim,n );
+//     vec smp ( dim );
+//     this->condition ( cond );
 //
-// 	for ( i=0; i<n; i++ ) {
-// 		smp = epdf.sample();
-// 		lik ( i ) = epdf.eval ( smp );
-// 		Smp.set_col ( i ,smp );
-// 	}
+//     for ( i=0; i<n; i++ ) {
+//         smp = epdf.sample();
+//         lik ( i ) = epdf.eval ( smp );
+//         Smp.set_col ( i ,smp );
+//     }
 //
-// 	return Smp;
+//     return Smp;
 // }
 
Index: library/bdm/stat/discrete.h
===================================================================
--- library/bdm/stat/discrete.h (revision 1064)
+++ library/bdm/stat/discrete.h (revision 1066)
@@ -163,5 +163,6 @@
 UIREGISTER ( grid_fnc );
 
-//! Piecewise constant pdf on rectangular support
+//! \brief Piecewise constant pdf on rectangular support
+//!
 //! Each point on the grid represents a centroid around which the density is constant.
 //! This is a trivial point-mass density where all points have the same mass.
@@ -177,5 +178,4 @@
         return log ( values ( sup.linear_index ( sup.nearest_point ( val ) ) ) );
     }
-
 };
 }
Index: library/bdm/stat/emix.h
===================================================================
--- library/bdm/stat/emix.h (revision 1064)
+++ library/bdm/stat/emix.h (revision 1066)
@@ -105,6 +105,5 @@
 class emix; //forward
 
-/*! Base class (Interface) for mixtures
-*/
+//! \brief Base class (interface) for mixtures
 class emix_base : public epdf {
 protected:
@@ -188,13 +187,18 @@
     }
 
-    //! Load from structure with elements:
-    //!  \code
-    //! { class='emix';
-    //!   pdfs = (..., ...);     // list of pdfs in the mixture
-    //!   weights = ( 0.5, 0.5 ); // weights of pdfs in the mixture
-    //! }
-    //! \endcode
-    //!@}
+    /*! Create object from the following structure
+
+    \code
+    class = 'emix';
+
+    pdfs = { list of any bdm::pdf offsprings };   % pdfs in the mixture, bdm::pdf::from_setting
+    weights = [... ];                             % vector of weights of pdfs in the mixture
+    --- inherited fields ---
+    bdm::emix_base::from_setting
+    \endcode
+
+    */
     void from_setting ( const Setting &set );
+
     void to_setting  (Setting  &set) const;
 
@@ -270,5 +274,5 @@
     //!@}
     void from_setting ( const Setting &set ) ;
-    void 	to_setting  (Setting  &set) const;
+    void     to_setting  (Setting  &set) const;
 
 
@@ -278,5 +282,5 @@
 
 
-//! Product of independent epdfs. For dependent pdfs, use mprod.
+//! \brief Base class (interface) for bdm::eprod
 class eprod_base: public epdf {
 protected:
@@ -335,4 +339,5 @@
 };
 
+//! \brief Product of independent epdfs. For dependent pdfs, use bdm::mprod.
 class eprod: public eprod_base {
 protected:
@@ -348,4 +353,15 @@
         factors = epdfs0;
     }
+
+    /*! Create object from the following structure
+
+    \code
+    class = 'eprod';
+    pdfs = { list of any bdm::epdf offsprings };   % pdfs in the product, bdm::epdf::from_setting
+    --- inherited fields ---
+    bdm::eprod_base::from_setting
+    \endcode
+
+    */
     void from_setting(const Setting &set) {
         UI::get(factors,set,"pdfs",UI::compulsory);
@@ -354,5 +370,5 @@
 UIREGISTER(eprod);
 
-//! similar to eprod but used only internally -- factors are external pointers
+//! \brief Internal class similar to eprod - factors are external pointers. To be used only internally!  
 class eprod_internal: public eprod_base {
 protected:
@@ -402,5 +418,5 @@
     //!@}
     void from_setting ( const Setting &set );
-    void 	to_setting  (Setting  &set) const;
+    void     to_setting  (Setting  &set) const;
     virtual void validate();
 };
@@ -409,6 +425,5 @@
 
 
-//! Base class for all BM running as parallel update of internal BMs
-
+//! \brief Base class for all BM running as parallel update of internal BMs
 class ProdBMBase : public BM {
 protected :
