Changeset 330
Legend:
- Unmodified
- Added
- Removed
-
bdm/stat/libEF.cpp
r283 r330 63 63 } 64 64 65 vec egiw::est_theta() const { 66 if ( dimx==1 ) { 67 const mat &L = V._L(); 68 int end = L.rows() - 1; 69 70 mat iLsub = ltuinv ( L ( dimx,end,dimx,end ) ); 71 72 vec L0 = L.get_col(0); 73 74 return iLsub * L0(1,end); 75 } 76 else { 77 it_error("ERROR: est_theta() not implemented for dimx>1"); 78 return 0; 79 } 80 } 81 82 ldmat egiw::est_theta_cov() const { 83 if ( dimx == 1 ) { 84 const mat &L = V._L(); 85 const vec &D = V._D(); 86 int end = D.length() - 1; 87 88 mat Lsub = L ( 1, end, 1, end); 89 mat Dsub = diag(D(1, end)); 90 91 return inv( transpose(Lsub) * Dsub * Lsub ); 92 93 } 94 else { 95 it_error("ERROR: est_theta_cov() not implemented for dimx>1"); 96 return 0; 97 } 98 99 } 100 65 101 vec egiw::mean() const { 66 102 67 103 if ( dimx==1 ) { 68 const mat &L= V._L();69 104 const vec &D= V._D(); 70 int end = L.rows()-1;105 int end = D.length()-1; 71 106 72 107 vec m ( dim ); 73 mat iLsub = ltuinv ( L ( dimx,end,dimx,end ) ); 74 75 vec L0 = L.get_col ( 0 ); 76 77 m.set_subvector ( 0,iLsub*L0 ( 1,end ) ); 108 m.set_subvector ( 0, est_theta() ); 78 109 m ( end ) = D ( 0 ) / ( nu -nPsi -2*dimx -2 ); 79 110 return m; … … 102 133 return var; 103 134 } 104 else {it_error("not implem neted"); return vec(0);}135 else {it_error("not implemented"); return vec(0);} 105 136 } 106 137 -
bdm/stat/libEF.h
r310 r330 201 201 vec mean() const; 202 202 vec variance() const; 203 204 //! LS estimate of \f$\theta\f$ 205 vec est_theta() const; 206 207 //! Covariance of the LS estimate 208 ldmat est_theta_cov() const; 209 203 210 void mean_mat ( mat &M, mat&R ) const; 204 211 //! In this instance, val= [theta, r]. For multivariate instances, it is stored columnwise val = [theta_1 theta_2 ... r_1 r_2 ]