Show
Ignore:
Timestamp:
07/02/09 22:16:05 (15 years ago)
Author:
smidl
Message:

Change in epdf: evallog returns -inf for points out of support. Merger is aware of it now.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/stat/exp_family.h

    r395 r404  
    5151                                double tmp; 
    5252                                tmp= evallog_nn ( val )-lognc(); 
    53                                 it_assert_debug ( std::isfinite ( tmp ),"Infinite value" );  
     53//                              it_assert_debug ( std::isfinite ( tmp ),"Infinite value" );  
    5454                                return tmp;} 
    5555                        //!Evaluate normalized log-probability for many samples 
     
    280280                        double evallog_nn ( const vec &val ) const 
    281281                        { 
    282                                 double tmp; tmp= ( beta-1 ) *log ( val );               it_assert_debug ( std::isfinite ( tmp ),"Infinite value" ); 
     282                                double tmp; tmp= ( beta-1 ) *log ( val ); 
     283//                              it_assert_debug ( std::isfinite ( tmp ),"Infinite value" ); 
    283284                                return tmp; 
    284285                        }; 
     
    290291                                for ( int i=0;i<beta.length();i++ ) {lgb+=lgamma ( beta ( i ) );} 
    291292                                tmp= lgb-lgamma ( gam ); 
    292                                 it_assert_debug ( std::isfinite ( tmp ),"Infinite value" ); 
     293//                              it_assert_debug ( std::isfinite ( tmp ),"Infinite value" ); 
    293294                                return tmp; 
    294295                        }; 
     
    489490 
    490491                        double eval ( const vec &val ) const  {return nk;} 
    491                         double evallog ( const vec &val ) const  {return lnk;} 
     492                        double evallog ( const vec &val ) const  { 
     493                                if (any(val<low) && any(val>high)) {return inf;} 
     494                                else return lnk; 
     495                        } 
    492496                        vec sample() const 
    493497                        {