Changeset 200 for bdm/stat/libEF.h

Show
Ignore:
Timestamp:
11/10/08 15:40:24 (16 years ago)
Author:
smidl
Message:

BM has now function _e() returning posterior of correct type

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • bdm/stat/libEF.h

    r198 r200  
    167167        int nPsi; 
    168168public: 
    169         //!Default constructor, assuming 
    170         egiw ( RV rv, mat V0, double nu0 ) : eEF ( rv ), V ( V0 ), nu ( nu0 ) { 
     169        //!Default constructor, if nu0<0 a minimal nu0 will be computed 
     170        egiw ( RV rv, mat V0, double nu0=-1.0 ) : eEF ( rv ), V ( V0 ), nu ( nu0 ) { 
    171171                xdim = rv.count() /V.rows(); 
    172172                it_assert_debug ( rv.count() ==xdim*V.rows(),"Incompatible V0." ); 
    173173                nPsi = V.rows()-xdim; 
     174                //set mu to have proper normalization and  
     175                if (nu0<0){ 
     176                        nu = 0.1 +nPsi +2*xdim +2; // +2 assures finite expected value of R 
     177                        // terms before that are sufficient for finite normalization 
     178                } 
    174179        } 
    175180        //!Full constructor for V in ldmat form 
    176         egiw ( RV rv, ldmat V0, double nu0 ) : eEF ( rv ), V ( V0 ), nu ( nu0 ) { 
     181        egiw ( RV rv, ldmat V0, double nu0=-1.0 ) : eEF ( rv ), V ( V0 ), nu ( nu0 ) { 
    177182                xdim = rv.count() /V.rows(); 
    178183                it_assert_debug ( rv.count() ==xdim*V.rows(),"Incompatible V0." ); 
    179184                nPsi = V.rows()-xdim; 
     185                if (nu0<0){ 
     186                        nu = 0.1 +nPsi +2*xdim +2; // +2 assures finite expected value of R 
     187                        // terms before that are sufficient for finite normalization 
     188                } 
    180189        } 
    181190 
     
    275284        } 
    276285        const epdf& _epdf() const {return est;}; 
     286        const eDirich* _e() const {return &est;}; 
    277287        void set_parameters ( const vec &beta0 ) { 
    278288                est.set_parameters ( beta0 );