Show
Ignore:
Timestamp:
05/26/10 23:33:28 (14 years ago)
Author:
smidl
Message:

Scheduling of forgetting factor

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • library/bdm/estim/arx.h

    r990 r996  
    105105        //! Smarter structure estimation by Ludvik Tesar.\return indices of accepted regressors. 
    106106        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        } 
    107116        //!@} 
    108117 
     
    138147                BMEF::validate();        
    139148                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"); 
    151157                        est.set_parameters(dimy, zeros(dimy+rgrlen+int(have_constant==true))); 
    152158                        set_prior_default(est); 
     
    213219 
    214220 
     221 
    215222//////////////////// 
    216223template<class sq_T>