Changeset 996 for library/bdm/estim/arx.h
- Timestamp:
- 05/26/10 23:33:28 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/arx.h
r990 r996 105 105 //! Smarter structure estimation by Ludvik Tesar.\return indices of accepted regressors. 106 106 ivec structure_est_LT ( egiw Eg0 ); 107 //! reduce to 108 void reduce_structure(ivec &inds_in_V){ 109 ldmat V = posterior()._V(); 110 if (max(inds_in_V)>=V.rows()) {bdm_error("Incompatible structure");} 111 112 ldmat newV(V,inds_in_V); 113 est.set_parameters(dimy,newV, posterior()._nu()); 114 validate(); 115 } 107 116 //!@} 108 117 … … 138 147 BMEF::validate(); 139 148 est.validate(); 140 //if dimc not set set it from V 141 if(dimy>0) {//statistics is assigned 142 if (posterior()._V().rows()>dimy) {//statistics is assigned 143 rgrlen=posterior()._V().rows() - dimy - int ( have_constant == true ); 144 } 145 } else{ 146 bdm_error("No posterior or yrv assigned matrix assigned"); 147 } 148 dimc =rgrlen; 149 150 if(est._dimx()==0) { // no prior 149 150 // When statistics is defined, it has priority 151 if(posterior()._dimx()>0) {//statistics is assigned 152 dimy = posterior()._dimx()>0; 153 rgrlen=posterior()._V().rows() - dimy - int ( have_constant == true ); 154 dimc = rgrlen; 155 } else{ // statistics is not assigned - build it from dimy and rgrlen 156 bdm_assert(dimy>0,"No way to validate egiw: empty statistics and empty dimy"); 151 157 est.set_parameters(dimy, zeros(dimy+rgrlen+int(have_constant==true))); 152 158 set_prior_default(est); … … 213 219 214 220 221 215 222 //////////////////// 216 223 template<class sq_T>