- Timestamp:
- 08/27/10 17:05:39 (14 years ago)
- Location:
- library/bdm/estim
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
library/bdm/estim/arx.cpp
r1064 r1166 7 7 8 8 BMEF::bayes_weighted(yt,cond,w); //potential discount scheduling 9 10 9 double lnc; 11 10 //cache … … 72 71 } 73 72 73 vec ARX::samplepred(const vec &cond) const{ 74 mat M; 75 chmat R; 76 est.sample_mat(M,R); 77 78 vec tmp; 79 if (dimc>0){ 80 if (have_constant){ 81 tmp = M*concat(cond,1.0); 82 } else { 83 tmp = M*cond; 84 } 85 } else { 86 tmp = zeros(dimy); 87 } 88 tmp += R._Ch().T()*randn(dimy); 89 return tmp; 90 } 91 74 92 void ARX::flatten ( const BMEF* B , double weight =1.0) { 75 93 const ARX* A = dynamic_cast<const ARX*> ( B ); … … 114 132 est.mean_mat ( mu, R ); //mu = 115 133 //correction for student-t -- TODO check if correct!! 116 //R*=nu/(nu-2);134 R*=posterior()._nu()/(posterior()._nu()-2); 117 135 if (mu.cols()>0) {// nonempty egiw 118 136 mat p_mu = mu.T() * ext_rgr; //the result is one column -
library/bdm/estim/arx.h
r1131 r1166 88 88 bayes_weighted ( yt, cond, 1.0 ); 89 89 }; 90 double logpred ( const vec &yt, const vec &cond ) const; 91 void flatten ( const BMEF* B , double weight ); 90 double logpred ( const vec &yt, const vec &cond ) const; 91 vec samplepred ( const vec &cond ) const; 92 void flatten ( const BMEF* B , double weight ); 92 93 //! Conditioned version of the predictor 93 94 enorm<ldmat>* epredictor ( const vec &rgr ) const;