Changeset 625 for library/bdm/estim/arx.h
- Timestamp:
- 09/18/09 00:17:05 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/arx.h
r585 r625 48 48 //! Do NOT access directly, only via \c get_yrv(). 49 49 RV _yrv; 50 //! rv of regressor 51 RV rgrrv; 50 52 //! Posterior estimate of \f$\theta,r\f$ in the form of Normal-inverse Wishart density 51 53 egiw est; … … 54 56 //! cached value of est.nu 55 57 double ν 58 //! switch if constant is modelled or not 59 bool have_constant; 60 //! cached value of data vector for have_constant =true 61 vec _dt; 56 62 public: 57 63 //! \name Constructors … … 73 79 //!@} 74 80 75 // //! Set parameters given by moments, \c mu (mean of theta), \c R (mean of R) and \c C (variance of theta)76 // void set_parameters ( const vec &mu, const mat &R, const mat &C, double dfm){};77 81 //! Set sufficient statistics 78 82 void set_statistics ( const BMEF* BM0 ); 79 // //! Returns sufficient statistics 80 // void get_parameters ( mat &V0, double &nu0 ) {V0=est._V().to_mat(); nu0=est._nu();} 83 81 84 //!\name Mathematical operations 82 85 //!@{ … … 121 124 //!\name Connection 122 125 //!@{ 123 void set_drv ( const RV &drv0 ) { 124 drv = drv0; 126 void set_rv ( const RV &yrv0 , const RV &rgrrv0 ) { 127 _yrv = yrv0; 128 rgrrv=rgrrv0; 129 set_drv(concat(yrv0, rgrrv)); 125 130 } 126 131 … … 140 145 //!@} 141 146 142 // TODO dokumentace - aktualizovat143 147 /*! UI for ARX estimator 144 148 145 The ARX is constructed from a structure with fields:146 149 \code 147 estimator = { 148 class = "ARX"; 149 y = {type="rv", ...} // description of output variables 150 rgr = {type="rv", ...} // description of regressor variables 151 constant = true; // boolean switch if the constant term is modelled or not 150 class = 'ARX'; 151 rv = RV({names_of_dt} ) // description of output variables 152 rgr = RV({names_of_regressors}, [-1,-2]} // description of regressor variables 153 constant = true; // boolean switch if the constant term is modelled or not 152 154 153 //optional fields 154 dV0 = [1e-3, 1e-5, 1e-5, 1e-5]; 155 // default: 1e-3 for y, 1e-5 for rgr 156 nu0 = 6; // default: rgrlen + 2 157 frg = 1.0; // forgetting, default frg=1.0 158 }; 155 --- optional --- 156 V0 = [1 0;0 1]; // Initial value of information matrix V 157 --- OR --- 158 dV0 = [1e-3, 1e-5, 1e-5, 1e-5]; // Initial value of diagonal of information matrix V 159 // default: 1e-3 for rv, 1e-5 for rgr 160 nu0 = 6; // initial value of nu, default: rgrlen + 2 161 frg = 1.0; // forgetting, default frg=1.0 162 163 rv_param = RV({names_of_parameters}} // description of parametetr names 164 // default: ["theta_i" and "r_i"] 159 165 \endcode 160 161 The estimator will assign names of the posterior in the form ["theta_i" and "r_i"]162 166 */ 163 167 void from_setting ( const Setting &set ); 164 168 169 void validate() { 170 bdm_assert(dimx == _yrv._dsize(), "RVs of parameters and regressor do not match"); 171 172 } 165 173 }; 166 174