Show
Ignore:
Timestamp:
08/16/09 18:13:31 (15 years ago)
Author:
smidl
Message:

removal of unused functions _e() and samplecond(,) and added documentation lines

Files:
1 modified

Legend:

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

    r535 r536  
    4444                //! logarithm of the normalizing constant, \f$\mathcal{I}\f$ 
    4545                virtual double lognc() const = 0; 
    46                 //!TODO decide if it is really needed 
    47                 virtual void dupdate (mat &v) {it_error ("Not implemented");}; 
    4846                //!Evaluate normalized log-probability 
    4947                virtual double evallog_nn (const vec &val) const{it_error ("Not implemented");return 0.0;}; 
     
    220218                ldmat est_theta_cov() const; 
    221219 
     220                //! expected values of the linear coefficient and the covariance matrix are written to \c M and \c R , respectively 
    222221                void mean_mat (mat &M, mat&R) const; 
    223222                //! In this instance, val= [theta, r]. For multivariate instances, it is stored columnwise val = [theta_1 theta_2 ... r_1 r_2 ] 
     
    340339                        if (evalll) {last_lognc = est.lognc();} 
    341340                } 
    342                 const epdf& posterior() const {return est;}; 
    343                 const eDirich* _e() const {return &est;}; 
     341                //! reimplemnetation of BM::posterior() 
     342                const eDirich& posterior() const {return est;}; 
     343                //! constructor function                 
    344344                void set_parameters (const vec &beta0) { 
    345345                        est.set_parameters (beta0); 
     
    373373 
    374374                vec sample() const; 
    375                 //! TODO: is it used anywhere? 
    376 //      mat sample ( int N ) const; 
    377375                double evallog (const vec &val) const; 
    378376                double lognc () const; 
    379                 //! Returns poiter to alpha and beta. Potentially dengerous: use with care! 
     377                //! Returns pointer to internal alpha. Potentially dengerous: use with care! 
    380378                vec& _alpha() {return alpha;} 
     379                //! Returns pointer to internal beta. Potentially dengerous: use with care! 
    381380                vec& _beta() {return beta;} 
    382381                vec mean() const {return elem_div (alpha, beta);} 
     
    482481                //!@} 
    483482 
    484                 double eval (const vec &val) const  {return nk;} 
    485483                double evallog (const vec &val) const  { 
    486484                        if (any (val < low) && any (val > high)) {return inf;} 
     
    516514 \brief Normal distributed linear function with linear function of mean value; 
    517515 
    518  Mean value \f$mu=A*rvc+mu_0\f$. 
     516 Mean value \f$ \mu=A*\mbox{rvc}+\mu_0 \f$. 
    519517*/ 
    520518template < class sq_T, template <typename> class TEpdf = enorm > 
     
    524522                //! Internal epdf that arise by conditioning on \c rvc 
    525523                mat A; 
     524                //! Constant additive term  
    526525                vec mu_const; 
    527526//                      vec& _mu; //cached epdf.mu; !!!!!! WHY NOT? 
     
    558557                mat _R() { return this->iepdf._R().to_mat(); } 
    559558 
     559                //! Debug stream 
    560560                template<typename sq_M> 
    561561                friend std::ostream &operator<< (std::ostream &os,  mlnorm<sq_M, enorm> &ml); 
     
    649649{ 
    650650        protected: 
     651                //! Variable \f$ \Lambda \f$ from theory 
    651652                ldmat Lambda; 
     653                //! Reference to variable \f$ R \f$ 
    652654                ldmat &_R; 
     655                //! Variable \f$ R_e \f$ 
    653656                ldmat Re; 
    654657        public: 
    655658                mlstudent () : mlnorm<ldmat, enorm> (), 
    656659                                Lambda (),      _R (iepdf._R()) {} 
     660                //! constructor function 
    657661                void set_parameters (const mat &A0, const vec &mu0, const ldmat &R0, const ldmat& Lambda0) { 
    658662                        it_assert_debug (A0.rows() == mu0.length(), ""); 
     
    968972                double delta; 
    969973        public: 
     974                //! Set internal structures 
    970975                void set_parameters (const mat &Y0, const double delta0) {Y = chmat (Y0);delta = delta0; p = Y.rows(); dim = p * p; } 
     976                //! Sample matrix argument 
    971977                mat sample_mat() const { 
    972978                        mat X = zeros (p, p); 
     
    9981004}; 
    9991005 
     1006//! Inverse Wishart on Choleski decomposition 
     1007/*! Being computed by conversion from `standard' Wishart 
     1008*/ 
    10001009class eiWishartCh: public epdf 
    10011010{ 
    10021011        protected: 
     1012                //! Internal instance of Wishart density 
    10031013                eWishartCh W; 
     1014                //! size of Ch 
    10041015                int p; 
     1016                //! parameter delta 
    10051017                double delta; 
    10061018        public: 
     1019                //! constructor function 
    10071020                void set_parameters (const mat &Y0, const double delta0) { 
    10081021                        delta = delta0; 
     
    10111024                } 
    10121025                vec sample() const {mat iCh; iCh = inv (W.sample_mat()); return vec (iCh._data(), dim);} 
     1026                //! access function 
    10131027                void _setY (const vec &y0) { 
    10141028                        mat Ch (p, p); 
     
    10441058}; 
    10451059 
     1060//! Random Walk on inverse Wishart 
    10461061class rwiWishartCh : public mpdf_internal<eiWishartCh> 
    10471062{ 
     
    10491064                //!square root of \f$ \nu-p-1 \f$ - needed for computation of \f$ \Psi \f$ from conditions 
    10501065                double sqd; 
    1051                 //reference point for diagonal 
     1066                //!reference point for diagonal 
    10521067                vec refl; 
     1068                //! power of the reference 
    10531069                double l; 
     1070                //! dimension 
    10541071                int p; 
    10551072 
    10561073        public: 
    10571074                rwiWishartCh() : sqd (0), l (0), p (0) {} 
    1058  
     1075                //! constructor function 
    10591076                void set_parameters (int p0, double k, vec ref0, double l0) { 
    10601077                        p = p0; 
     
    13261343void mgnorm<sq_T >::condition (const vec &cond) {this->iepdf._mu() = g->eval (cond);}; 
    13271344 
     1345//! \todo unify this stuff with to_string() 
    13281346template<class sq_T> 
    13291347std::ostream &operator<< (std::ostream &os,  mlnorm<sq_T> &ml)