Changeset 797 for library/bdm

Show
Ignore:
Timestamp:
01/29/10 19:56:54 (14 years ago)
Author:
smidl
Message:

new objects: mgdirac + mexFnc

Location:
library/bdm
Files:
1 added
3 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/base/bdmbase.h

    r795 r797  
    361361        }; 
    362362 
    363         //! function substitutes given value into an appropriate position 
    364         virtual void condition ( const vec &val ) {}; 
    365  
    366363        //! access function 
    367364        int dimension() const { 
     
    371368        int dimensionc() const { 
    372369                return dimc; 
     370        } 
     371        void from_setting(const Setting &set){ 
     372                UI::get(dimy, set, "dim", UI::optional); 
     373                UI::get(dimc, set, "dimc", UI::optional); 
    373374        } 
    374375}; 
  • library/bdm/estim/ekf_template.h

    r766 r797  
    6060}; 
    6161 
    62 //!Extended Kalman filter with unknown parameters in \c IM 
    63 class EKFCh_cond : public EKFCh  { 
    64 public: 
    65         void condition ( const vec &val ) { 
    66                 pfxu->condition ( val ); 
    67         }; 
    68 }; 
     62////!Extended Kalman filter with unknown parameters in \c IM 
     63// class EKFCh_cond : public EKFCh  { 
     64// public: 
     65//      void condition ( const vec &val ) { 
     66//              pfxu->condition ( val ); 
     67//      }; 
     68// }; 
    6969 
    7070} 
  • library/bdm/stat/exp_family.h

    r796 r797  
    116116        } 
    117117}; 
     118 
     119/*! Dirac delta density with predefined transformation 
     120 
     121Density of the type:\f[ f(x_t | y_t) = \delta (x_t - g(y_t)) \f] 
     122where \f$ x_t \f$ is the \c rv, \f$ y_t \f$ is the \c rvc and g is a deterministic transformation of class fn. 
     123*/ 
     124class mgdirac: public pdf{ 
     125        protected: 
     126        shared_ptr<fnc> g; 
     127        public: 
     128                vec samplecond(const vec &cond) { 
     129                        bdm_assert_debug(cond.length()==g->dimensionc(),"given cond in not compatible with g"); 
     130                        vec tmp = g->eval(cond); 
     131                        return tmp; 
     132                }  
     133                double evallogcond ( const vec &yt, const vec &cond ){ 
     134                        return std::numeric_limits< double >::max(); 
     135                } 
     136                void from_setting(const Setting& set){ 
     137                        pdf::from_setting(set); 
     138                        g=UI::build<fnc>(set,"g",UI::compulsory); 
     139                        validate(); 
     140                } 
     141                void to_setting(Setting &set) const{ 
     142                        pdf::to_setting(set); 
     143                        UI::save(g.get(), set, "g"); 
     144                } 
     145                void validate() { 
     146                        dim = g->dimension(); 
     147                        dimc = g->dimensionc(); 
     148                } 
     149}; 
     150UIREGISTER(mgdirac); 
     151 
    118152 
    119153template<class sq_T, template <typename> class TEpdf>