Changeset 639
- Timestamp:
- 09/27/09 00:58:06 (15 years ago)
- Location:
- library/bdm/estim
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/arx.cpp
r631 r639 4 4 void ARX::bayes ( const vec &dt, const double w ) { 5 5 double lnc; 6 7 6 8 7 if ( frg < 1.0 ) { 9 8 est.pow ( frg ); 9 10 //stabilize 11 ldmat V0(eye(V.rows())); 12 V0*=(1-frg)*1e-3; 13 V += V0; //stabilization 14 nu +=(1-frg)*(0.1 + V.rows() + 1* dimx + 2); 15 16 // recompute loglikelihood of "prior" 10 17 if ( evalll ) { 11 18 last_lognc = est.lognc(); -
library/bdm/estim/arx.h
r631 r639 60 60 //! cached value of data vector for have_constant =true 61 61 vec _dt; 62 //! Alternative estimate of parameters, used in stabilized forgetting, see [Kulhavy] 63 egiw alter_est; 62 64 public: 63 65 //! \name Constructors 64 66 //!@{ 65 ARX ( const double frg0 = 1.0 ) : BMEF ( frg0 ), est (), V ( est._V() ), nu ( est._nu() ) {}; 66 ARX ( const ARX &A0 ) : BMEF (), est (), V ( est._V() ), nu ( est._nu() ) { 67 set_statistics ( A0.dimx, A0.V, A0.nu ); 68 set_parameters ( A0.frg ); 67 ARX ( const double frg0 = 1.0 ) : BMEF ( frg0 ), est (), V ( est._V() ), nu ( est._nu() ), have_constant(true), _dt() {}; 68 ARX ( const ARX &A0 ) : BMEF (A0.frg), est (A0.est), V ( est._V() ), nu ( est._nu() ), have_constant(A0.have_constant), _dt(A0._dt) { 69 dimx = A0.dimx; 70 _yrv = A0._yrv; 71 rgrrv = A0.rgrrv; 72 set_drv(A0._drv()); 69 73 }; 70 74 ARX* _copy_() const; … … 176 180 SHAREDPTR ( ARX ); 177 181 178 } 179 182 /*! ARX model conditined by knowledge of the forgetting factor 183 \f[ f(\theta| d_1 \ldots d_t , \phi_t) \f] 184 */ 185 class ARXfrg : public ARX{ 186 public: 187 ARXfrg():ARX(){}; 188 ARXfrg(const ARXfrg &A0):ARX(A0){}; 189 ARXfrg* _copy_() const {ARXfrg *A = new ARXfrg(*this); return A;} 190 void condition(const vec &val){ 191 frg = val(0); 192 } 193 }; 194 UIREGISTER(ARXfrg); 195 }; 180 196 #endif // AR_H 181 197