Home  Trees  Indices  Help 



This class stores an empirical covariance matrix that can be updated incrementally. A call to the 'fix' method returns the current state of the covariance matrix, the average and the number of observations, and resets the internal data.
Note that the internal sum is a standard __add__ operation. We are not using any of the fancy sum algorithms to avoid round off errors when adding many numbers. If you want to contribute a CovarianceMatrix class that uses such algorithms we would be happy to include it in MDP. For a start see the Python recipe by Raymond Hettinger at http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/393090 For a review about floating point arithmetic and its pitfalls see http://docs.oracle.com/cd/E1995701/8063568/ncg_goldberg.html










Inherited from Inherited from 


Inherited from 


Init the internal structures. The reason this is not done in the constructor is that we want to be able to derive the input dimension and the dtype directly from the data this class receives. 
Returns a triple containing the covariance matrix, the average and the number of observations. The covariance matrix is then reset to a zerostate. If center is false, the returned matrix is the matrix of the second moments, i.e. the covariance matrix of the data without subtracting the mean. 
Update internal structures. Note that no consistency checks are performed on the data (this is typically done in the enclosing node). 
Home  Trees  Indices  Help 


Generated by Epydoc 3.0.1 on Tue Mar 8 12:39:48 2016  http://epydoc.sourceforge.net 