Changeset 168 for bdm/stat/libEF.h

Show
Ignore:
Timestamp:
09/18/08 19:54:09 (16 years ago)
Author:
smidl
Message:

Work on mixtures of EF, small changes

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/libEF.h

    r162 r168  
    113113* \brief Gauss-inverse-Wishart density stored in LD form 
    114114 
    115 * More?... 
     115* For \f$p\f$-variate densities, given rv.count() should be \f$p\times\f$ V.rows(). 
     116* 
    116117*/ 
    117118class egiw : public eEF { 
     
    121122        //! Number of data records (degrees of freedom) of sufficient statistics 
    122123        double nu; 
    123 public: 
    124         //!Default constructor 
     124        //! Dimension of the output 
     125        int xdim; 
     126        //! Dimension of the regressor 
     127        int nPsi; 
     128public: 
     129        //!Default constructor, assuming 
    125130        egiw(RV rv, mat V0, double nu0): eEF(rv), V(V0), nu(nu0) { 
    126                 it_assert_debug(rv.count()==V.rows(),"Incompatible V0."); 
     131                xdim = rv.count()/V.rows(); 
     132                it_assert_debug(rv.count()==xdim*V.rows(),"Incompatible V0."); 
     133                nPsi = V.rows()-xdim; 
    127134        } 
    128135 
    129136        vec sample() const; 
    130137        vec mean() const; 
     138        //! In this instance, val= [theta, r]. For multivariate instances, it is stored columnwise val = [theta_1 theta_2 ... r_1 r_2 ] 
    131139        double evalpdflog ( const vec &val ) const; 
    132140        double lognc () const;