- Timestamp:
- 05/23/10 11:40:38 (15 years ago)
- Location:
- library/bdm/estim
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/arx.cpp
r964 r973 103 103 //correction for student-t -- TODO check if correct!! 104 104 //R*=nu/(nu-2); 105 mat p_mu = mu.T() * rgr; //the result is one column 106 tmp->set_parameters ( p_mu.get_col ( 0 ), ldmat ( R ) ); 105 if (mu.cols()>0) {// nonempty egiw 106 mat p_mu = mu.T() * rgr; //the result is one column 107 tmp->set_parameters ( p_mu.get_col ( 0 ), ldmat ( R ) ); 108 } else { 109 tmp->set_parameters ( zeros( R.rows() ), ldmat ( R ) ); 110 } 111 if (dimy==yrv._dsize()) 112 tmp->set_rv(yrv); 107 113 return tmp; 108 114 } … … 237 243 //init 238 244 shared_ptr<egiw> pri = UI::build<egiw> ( set, "prior", UI::optional ); 239 if ( pri ) {240 bdm_assert ( pri->_dimx() == dimy, "prior is not compatible" );241 bdm_assert ( pri->_V().rows() == dimy + rgrlen, "prior is not compatible" );242 est.set_parameters ( pri->_dimx(), pri->_V(), pri->_nu() );243 est.validate();244 } else {245 est.set_parameters ( dimy, zeros ( dimy + rgrlen ) );246 est.validate();247 set_prior_default ( est );248 }249 245 250 246 shared_ptr<egiw> alt = UI::build<egiw> ( set, "alternative", UI::optional ); … … 254 250 alter_est.set_parameters ( alt->_dimx(), alt->_V(), alt->_nu() ); 255 251 alter_est.validate(); 256 } else { 252 } 253 // frg handled by BMEF 254 255 } 256 257 void ARX::set_prior(const epdf *pri){ 258 const egiw * eg=dynamic_cast<const egiw*>(pri); 259 if ( eg ) { 260 bdm_assert ( eg->_dimx() == dimy, "prior is not compatible" ); 261 bdm_assert ( eg->_V().rows() == dimy + rgrlen, "prior is not compatible" ); 262 est.set_parameters ( eg->_dimx(), eg->_V(), eg->_nu() ); 263 est.validate(); 264 } else { 265 est.set_parameters ( dimy, zeros ( dimy + rgrlen ) ); 266 est.validate(); 267 set_prior_default ( est ); 268 } 269 //check alternative 270 if (alter_est.dimension()!=dimension()){ 257 271 alter_est = est; 258 272 } 259 260 // frg handled by BMEF 261 262 } 263 264 } 265 273 } 274 } 275 -
library/bdm/estim/arx.h
r964 r973 149 149 } 150 150 //! function sets prior and alternative density 151 void set_prior ( const RV &drv, egiw &prior ) { 152 //TODO check ranges in RV and build prior 153 }; 151 void set_prior ( const epdf *prior ); 154 152 //! build default prior and alternative when all values are set 155 153 void set_prior_default ( egiw &prior ) {