Changeset 85
- Timestamp:
- 04/28/08 10:21:21 (17 years ago)
- Location:
- bdm
- Files:
-
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/estim/libKF.h
r83 r85 262 262 A ( dimx,dimx ), B ( dimx,dimu ), C ( dimy,dimx ), D ( dimy,dimu ), 263 263 Q(dimx), R(dimy), 264 est ( rv ), fy ( rvy ), _ mu(est._mu()), _P(est._R()), _yp(fy._mu()),_Ry(fy._R()) {264 est ( rv ), fy ( rvy ), _yp(fy._mu()),_Ry(fy._R()), _mu(est._mu()), _P(est._R()) { 265 265 266 266 this->set_parameters ( K0.A, K0.B, K0.C, K0.D, K0.R, K0.Q ); … … 279 279 A ( dimx,dimx ), B ( dimx,dimu ), C ( dimy,dimx ), D ( dimy,dimu ), 280 280 Q(dimx), R (dimy), 281 est ( rvx ), fy ( rvy ), _mu(est._mu()), _P(est._R()), _yp(fy._mu()),_Ry(fy._R()) {281 est ( rvx ), fy ( rvy ), _yp(fy._mu()),_Ry(fy._R()),_mu(est._mu()), _P(est._R()) { 282 282 }; 283 283 -
bdm/math/libDC.h
r75 r85 149 149 vec sqrt_mult (const vec &v ) const {mat Ch=chol(M); return Ch*v;}; 150 150 151 //! Add another matrix in fsq form with weight w 152 void add ( const fsqmat &fsq2, double w=1.0 ){M+=fsq2.M;}; 153 151 154 //! Access functions 152 155 void setD (const vec &nD){M=diag(nD);} … … 155 158 //! Access functions 156 159 void setD (const vec &nD, int i){for(int j=i;j<nD.length();j++){M(j,j)=nD(j-i);}} //Fixme can be more general 160 157 161 158 162 //! add another fsqmat matrix -
bdm/stat/libBM.cpp
r32 r85 24 24 sizes = in_sizes; 25 25 times = in_times; 26 size = 0;27 for(i=0;i<len;i++){ size+=sizes(i);}26 tsize = 0; 27 for(i=0;i<len;i++){tsize+=sizes(i);} 28 28 }; 29 29 … … 32 32 } 33 33 34 RV::RV () : size(0),len(0){};34 RV::RV () : tsize(0),len(0){}; 35 35 36 36 void RV::add (const RV &rv2) { 37 37 // TODO 38 size+=rv2.size;38 tsize+=rv2.tsize; 39 39 len +=rv2.len; 40 40 ids=concat(ids,rv2.ids); … … 78 78 79 79 ivec RV::indexlist(){ 80 ivec indlist( size);80 ivec indlist(tsize); 81 81 int i; 82 82 int pos = 0; -
bdm/stat/libBM.h
r62 r85 28 28 protected: 29 29 //! size = sum of sizes 30 int size;30 int tsize; 31 31 //! len = number of individual rvs 32 32 int len; … … 54 54 friend std::ostream &operator<< ( std::ostream &os, const RV &rv ); 55 55 56 //! Return length (number of scalars) of the RV. 57 int count() const {return size;} ; 56 //! Return number of scalars in the RV. 57 int count() const {return tsize;} ; 58 //! Return length (number of entries) of the RV. 59 int length() const {return len;} ; 58 60 59 61 //TODO why not inline and later?? … … 62 64 ivec find ( RV rv2 ); 63 65 //! Add (concat) another variable to the current one 64 void add (const RV &rv2 );66 void add (const RV &rv2 ); 65 67 //! Add (concat) another variable to the current one 66 68 friend RV concat (const RV &rv1, const RV &rv2 ); … … 78 80 //!access function 79 81 Array<std::string>& _names(){return names;}; 80 }; 81 82 83 //! Class representing function $f(x)$ of variable $x$ represented by \c rv 82 83 //!access function 84 int id(int at){return ids(at);}; 85 //!access function 86 int size(int at){return sizes(at);}; 87 //!access function 88 int time(int at){return times(at);}; 89 //!access function 90 std::string name(int at){return names(at);}; 91 }; 92 93 94 //! Class representing function \f$f(x)\f$ of variable \f$x\f$ represented by \c rv 84 95 85 96 class fnc { … … 90 101 //!default constructor 91 102 fnc(int dy):dimy(dy){}; 92 //! function evaluates numerical value of $f(x)$ at $x=cond$103 //! function evaluates numerical value of \f$f(x)\f$ at \f$x=\f$ \c cond 93 104 virtual vec eval ( const vec &cond ) { 94 105 return vec ( 0 ); … … 199 210 void linkrvs ( RV &drv, RV &urv ); 200 211 201 //! Moves from $t$ to $t+1$, i.e. perfroms the actions and reads response of the system.212 //! Moves from \f$t\f$ to \f$t+1\f$, i.e. perfroms the actions and reads response of the system. 202 213 void step(); 203 214 … … 242 253 \brief Conditional Bayesian Filter 243 254 244 Evaluates conditional filtering density $f(rv|rvc,data)$ for a given \c rvc which is specified in each step by calling function \c condition.255 Evaluates conditional filtering density \f$f(rv|rvc,data)\f$ for a given \c rvc which is specified in each step by calling function \c condition. 245 256 246 257 This is an interface class used to assure that certain BM has operation \c condition . -
bdm/stat/libDS.h
r33 r85 22 22 * \brief Class representing off-line data stored in memory 23 23 24 The data are stored in an internal matrix \c Data . Each column of Data corresponds to one discrete time observation $t$. Access to this matrix is via indexes \c rowid and \c delays.24 The data are stored in an internal matrix \c Data . Each column of Data corresponds to one discrete time observation \f$t\f$. Access to this matrix is via indexes \c rowid and \c delays. 25 25 26 26 The data can be loaded from a file. -
bdm/stat/libEF.h
r77 r85 191 191 \brief Normal distributed linear function with linear function of mean value; 192 192 193 Mean value $mu=A*rvc$.193 Mean value \f$mu=A*rvc\f$. 194 194 */ 195 195 template<class sq_T> … … 197 197 //! Internal epdf that arise by conditioning on \c rvc 198 198 enorm<sq_T> epdf; 199 mat A; 199 200 vec& _mu; //cached epdf.mu; 200 mat A;201 201 public: 202 202 //! Constructor … … 216 216 217 217 Mean value, \f$\mu\f$, of this density is given by \c rvc . 218 Standard deviation of the random walk is proportional to one $k$-th the mean.218 Standard deviation of the random walk is proportional to one \f$k\f$-th the mean. 219 219 This is achieved by setting \f$\alpha=k\f$ and \f$\beta=k/\mu\f$. 220 220 … … 225 225 //! Internal epdf that arise by conditioning on \c rvc 226 226 egamma epdf; 227 //! Constant $k$227 //! Constant \f$k\f$ 228 228 double k; 229 229 //! cache of epdf.beta … … 245 245 \brief Gamma random walk around a fixed point 246 246 247 Mean value, \f$\mu\f$, of this density is given by a geometric combination of \c rvc and given fixed point, $p$. $k$ is the coefficient of the geometric combimation247 Mean value, \f$\mu\f$, of this density is given by a geometric combination of \c rvc and given fixed point, \f$p\f$. \f$l\f$ is the coefficient of the geometric combimation 248 248 \f[ \mu = \mu_{t-1} ^{l} p^{1-l}\f] 249 249 250 Standard deviation of the random walk is proportional to one $k$-th the mean.250 Standard deviation of the random walk is proportional to one \f$k\f$-th the mean. 251 251 This is achieved by setting \f$\alpha=k\f$ and \f$\beta=k/\mu\f$. 252 252 … … 280 280 //! Number of particles 281 281 int n; 282 //! Sample weights $w$282 //! Sample weights \f$w\f$ 283 283 vec w; 284 284 //! Samples \f$x^{(i)}, i=1..n\f$ -
bdm/stat/libFN.h
r62 r85 18 18 using namespace itpp; 19 19 20 //! class representing function $f(x) = a$, hererv is empty20 //! class representing function \f$f(x) = a\f$, here \c rv is empty 21 21 class constfn : public fnc 22 22 { … … 32 32 }; 33 33 34 //! Class representing function $f(x) = Ax+B$34 //! Class representing function \f$f(x) = Ax+B\f$ 35 35 class linfn: public fnc 36 36 { 37 //! Identification of $x$37 //! Identification of \f$x\f$ 38 38 RV rv; 39 39 //! Matrix A … … 53 53 54 54 /*! 55 \brief Class representing a differentiable function of two variables $f(x,u)$.55 \brief Class representing a differentiable function of two variables \f$f(x,u)\f$. 56 56 57 57 Function of two variables. … … 73 73 int dimu; 74 74 public: 75 //! Evaluates $f(x0,u0)$ (VS: Do we really need common eval? )75 //! Evaluates \f$f(x0,u0)\f$ (VS: Do we really need common eval? ) 76 76 vec eval ( const vec &cond ) 77 77 { … … 80 80 }; 81 81 82 //! Evaluates $f(x0,u0)$82 //! Evaluates \f$f(x0,u0)\f$ 83 83 virtual vec eval ( const vec &x0, const vec &u0 ) {return zeros ( dimy );}; 84 //! Evaluates \f$A=\frac{d}{dx}f(x,u)|_{x0,u0}\f$ and writes result into \c A . @param full denotes that even unchanged entries are to be rewritten. When, false only the changed elements are computed. @param x0 numeric value of $x$, @param u0 numeric value of $u$ @param A a place where the result will be stored.84 //! Evaluates \f$A=\frac{d}{dx}f(x,u)|_{x0,u0}\f$ and writes result into \c A . @param full denotes that even unchanged entries are to be rewritten. When, false only the changed elements are computed. @param x0 numeric value of \f$x\f$, @param u0 numeric value of \f$u\f$ @param A a place where the result will be stored. 85 85 virtual void dfdx_cond ( const vec &x0, const vec &u0, mat &A , bool full=true ) {}; 86 //! Evaluates \f$A=\frac{d}{du}f(x,u)|_{x0,u0}\f$ and writes result into \c A . @param full denotes that even unchanged entries are to be rewritten. When, false only the changed elements are computed. @param x0 numeric value of $x$, @param u0 numeric value of $u$ @param A a place where the result will be stored.86 //! Evaluates \f$A=\frac{d}{du}f(x,u)|_{x0,u0}\f$ and writes result into \c A . @param full denotes that even unchanged entries are to be rewritten. When, false only the changed elements are computed. @param x0 numeric value of \f$x\f$, @param u0 numeric value of \f$u\f$ @param A a place where the result will be stored. 87 87 virtual void dfdu_cond ( const vec &x0, const vec &u0, mat &A, bool full=true ) {}; 88 88 //!Default constructor (dimy is not set!) … … 94 94 }; 95 95 96 //! Class representing function $f(x,u) = Ax+Bu$96 //! Class representing function \f$f(x,u) = Ax+Bu\f$ 97 97 //TODO can be generalized into multilinear form! 98 98 class bilinfn: public diffbifn