Changeset 229 for bdm/estim/libPF.h
- Timestamp:
- 01/15/09 10:53:54 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
bdm/estim/libPF.h
r225 r229 88 88 // ugly 89 89 vec pom=zeros ( ( Coms ( 0 )->_rv() ).count() ); 90 91 90 for ( int i=0; i<_w.length(); i++ ) {pom += Coms ( i )->mean() * _w ( i );} 92 93 91 return concat ( E.mean(),pom ); 92 } 93 vec variance() const { 94 // ugly 95 vec pom=zeros ( ( Coms ( 0 )->_rv() ).count() ); 96 vec pom2=zeros ( ( Coms ( 0 )->_rv() ).count() ); 97 for ( int i=0; i<_w.length(); i++ ) { 98 pom += Coms ( i )->mean() * _w ( i ); 99 pom2 += (Coms ( i )->variance() + pow(Coms(i)->mean(),2)) * _w ( i );} 100 return concat ( E.variance(),pom2-pow(pom,2) ); 94 101 } 95 102