|
Darwin
1.10(beta)
|
Implements a class for accumulating first- and second-order sufficient statistics (moments). More...
Public Member Functions | |
| drwnSuffStats (int n=1, drwnPairSuffStatsType pairStats=DRWN_PSS_FULL) | |
construct a sufficient statistic object of dimensionality n | |
| drwnSuffStats (double count, VectorXd &sum, MatrixXd &sum2) | |
| construct a sufficient statistic object with initial counts | |
| drwnSuffStats (const drwnSuffStats &stats) | |
| copy constructor | |
| void | clear () |
| clear the accumulated counts | |
| void | clear (int n, drwnPairSuffStatsType pairStats=DRWN_PSS_FULL) |
| clear the accumulated counts and re-initialize the dimensionality of the sufficient statistics | |
| void | diagonalize () |
| diagonalize the second-order sufficient statistics | |
| int | size () const |
| return the dimensionality of the sufficient statistics | |
| bool | isDiagonal () const |
| return true if only accumulating diagonalized statistics (i.e., no cross terms) | |
| bool | hasPairs () const |
| return true if accumulating both first- and second-order statistics | |
| double | count () const |
| return the weighted count of samples accumulated | |
| double | sum (int i=0) const |
| return the weighted sum of samples accumulated for a given dimension | |
| double | sum2 (int i=0, int j=0) const |
| return the weighted sum-of-squares of samples accumulated a given dimension | |
| const VectorXd & | firstMoments () const |
| return the first moment return the weighted sum of samples accumulated | |
| MatrixXd | secondMoments () const |
| return the weighted sum-of-squares of samples accumulated | |
| const char * | type () const |
| returns object type as a string (e.g., Foo::type() { return "Foo"; }) | |
| drwnSuffStats * | clone () const |
| returns a copy of the class usually implemented as virtual Foo* clone() { return new Foo(*this); } | |
| bool | save (drwnXMLNode &xml) const |
| write object to XML node (see also write) | |
| bool | load (drwnXMLNode &xml) |
| read object from XML node (see also read) | |
| void | accumulate (const vector< double > &x) |
| add a single sample to the sufficient statistics | |
| void | accumulate (const vector< double > &x, double w) |
| add a single weighted sample to the sufficient statistics | |
| void | accumulate (const vector< vector< double > > &x, double w=1.0) |
| add a number of samples to the sufficient statistics | |
| void | accumulate (const drwnSuffStats &stats, double w=1.0) |
| add previously accumulated sufficient statistics | |
| void | subtract (const vector< double > &x) |
| remove a single sample from the sufficient statistics | |
| void | subtract (const vector< double > &x, double w) |
| remove a single weighted sample from the sufficient statistics | |
| void | subtract (const vector< vector< double > > &x, double w=1.0) |
| remove a number of samples from the sufficient statistics | |
| void | subtract (const drwnSuffStats &stats, double w=1.0) |
| remove previously accumulated sufficient statistics | |
| drwnSuffStats & | operator= (const drwnSuffStats &stats) |
| assignment operator | |
Public Member Functions inherited from drwnWriteable | |
| bool | write (const char *filename) const |
| write object to file (calls save) | |
| bool | read (const char *filename) |
| read object from file (calls load) | |
| void | dump () const |
| print object's current state to standard output (for debugging) | |
Implements a class for accumulating first- and second-order sufficient statistics (moments).
When not maintaining full pairwise statistics, only keeps a vector of second-order statistics, which saves a lot of space.
1.8.6