Show
Ignore:
Timestamp:
08/18/11 16:02:53 (13 years ago)
Author:
sindj
Message:

Program update, kontrola vypoctu provedena, integruje spravne v nedegenerovanem pripade. JS

Files:
1 modified

Legend:

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

    r1359 r1383  
    311311         
    312312        void bayes ( const vec &val, const vec &cond ) { 
    313                 // fill window 
    314                 Y.append_col(val); 
    315                 Cond.append_col(cond);           
    316                 if (Y.cols()>win_length){ 
    317                         // shift the buffer 
    318                         Y=Y.get_cols(1,Y.cols()-1); 
    319                         Cond=Cond.get_cols(1,Cond.cols()-1); 
     313                 
     314                if(cond.size()>0) 
     315                { 
     316                        // fill window 
     317                        Y.append_col(val); 
     318                        Cond.append_col(cond);           
     319                        if (Y.cols()>win_length){ 
     320                                // shift the buffer 
     321                                Y=Y.get_cols(1,Y.cols()-1); 
     322                                Cond=Cond.get_cols(1,Cond.cols()-1); 
     323                        } 
     324                         
     325                        est._V()=V0; 
     326                        est._nu()=nu0; 
     327                        for ( int t = 0; t < Y.cols(); t++ ) { 
     328                                ARX::bayes ( Y.get_col ( t ), Cond.get_col ( t ) ); 
     329                        } 
     330                } 
     331                else 
     332                { 
     333                        Y.append_col(val); 
     334 
     335                        if (Y.cols()>win_length){ 
     336                                // shift the buffer 
     337                                Y=Y.get_cols(1,Y.cols()-1);                              
     338                        } 
     339 
     340                        est._V()=V0; 
     341                        est._nu()=nu0; 
     342 
     343                        for ( int t = 0; t < Y.cols(); t++ ) { 
     344                                ARX::bayes (Y.get_col ( t )); 
     345                        } 
    320346                } 
    321347                 
    322                 est._V()=V0; 
    323                 est._nu()=nu0; 
    324                 for ( int t = 0; t < Y.cols(); t++ ) { 
    325                         ARX::bayes ( Y.get_col ( t ), Cond.get_col ( t ) ); 
    326                 } 
    327                  
    328         } 
     348        } 
     349 
    329350        void from_setting(const Setting &set){ 
    330351                ARX::from_setting(set);