Changeset 963
- Timestamp:
- 05/20/10 10:05:37 (14 years ago)
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/bdmtoolbox/mex/class_defaults.cpp
r962 r963 54 54 #else 55 55 UIFile Out; 56 UI::save( *r,Out);56 UI::save(r,Out); 57 57 Out.writeFile("defaults"); 58 58 #endif -
library/bdm/estim/kalman.h
r907 r963 75 75 validate(); 76 76 } 77 void to_setting ( Setting &set ) const { 78 UI::save( A, set, "A" ); 79 UI::save( B, set, "B" ); 80 UI::save( C, set, "C" ); 81 UI::save( D, set, "D" ); 82 UI::save( Q.to_mat(), set, "Q" ); 83 UI::save( R.to_mat(), set, "R" ); 84 } 77 85 //! access function 78 86 const mat& _A() const { … … 130 138 } 131 139 //! load basic elements of Kalman from structure 140 /*! \code 141 class = 'KalmanFull'; 142 A = []; // Matrix A 143 B = []; // Matrix B 144 C = []; // Matrix C 145 D = []; // Matrix D 146 Q = []; // Matrix Q 147 R = []; // Matrix R 148 prior = struct('class','epdf_offspring'); // Prior density - will be converted to gaussian 149 rvy = RV('some_names'); // Description of required observations 150 rvc = RV('some_names'); // Description of required inputs 151 \endcode 152 153 */ 132 154 void from_setting ( const Setting &set ) { 133 155 StateSpace<sq_T>::from_setting ( set ); 134 135 mat P0; 136 vec mu0; 137 UI::get ( mu0, set, "mu0", UI::optional ); 138 UI::get ( P0, set, "P0", UI::optional ); 139 set_statistics ( mu0, P0 ); 140 // Initial values 141 shared_ptr<RV> yrv_ptr = UI::build<RV>( set, "yrv", UI::optional ); 142 if( !yrv_ptr ) yrv_ptr = new RV(); 143 shared_ptr<RV> rvc_ptr = UI::build<RV>( set, "urv", UI::optional ); 144 if( !rvc_ptr ) rvc_ptr = new RV(); 145 set_yrv ( concat ( *yrv_ptr, *rvc_ptr ) ); 156 BM::from_setting(set); 157 158 shared_ptr<epdf> pri=UI::build<epdf>(set,"prior",UI::compulsory); 159 //bdm_assert(pri->dimension()==); 160 set_statistics ( pri->mean(), pri->covariance() ); 161 } 162 void to_setting ( Setting &set ) const { 163 StateSpace<sq_T>::to_setting ( set ); 164 BM::to_setting(set); 165 166 UI::save(est, set, "prior"); 146 167 } 147 168 //! validate object