golib  0.5
goMath::MultiGaussPDF< input_vector, scalar_type > Class Template Reference

Vector values Gauss distribution. More...

#include <gogausspdf.h>

Public Member Functions

 MultiGaussPDF (const input_vector &mean, const goMath::Matrix< scalar_type > &cov, scalar_type normFactor=scalar_type(1))
 
virtual scalar_type operator() (const input_vector &input) const
 
void reset (goSize_t N=1)
 Resets sample count, covariance matrix, etc., before using update() to learn a distribution from samples. More...
 
void update (const input_vector &v)
 Update current mean and covariance. More...
 
void updateFlush ()
 Ending learning from samples. More...
 
void setCovariance (const goMath::Matrix< scalar_type > &cov)
 
const goMath::Matrix< scalar_type > & getCovarianceInv () const
 
const goMath::Matrix< scalar_type > & getCovariance () const
 
void setMean (const input_vector &m)
 
const input_vector & getMean () const
 
- Public Member Functions inherited from goObjectBase
 goObjectBase ()
 Constructor.
 
virtual ~goObjectBase ()
 Destructor. More...
 
const char * getClassName () const
 Returns the class name. More...
 
int getClassID () const
 
virtual goSize_t memoryUsage () const
 Returns the size of this object or some measure of its memory consumption. More...
 
void setObjectName (const char *name)
 Set name string for an object. More...
 
void setObjectName (const goString &name)
 Set name string for an object. More...
 
const goStringgetObjectName () const
 Get the object name. More...
 
virtual bool writeObjectFile (FILE *) const
 Write object to a file. More...
 
virtual bool readObjectFile (FILE *)
 Read object from a file. More...
 
void connectObject (goObjectBase *object)
 Connects an object to this object. More...
 
void disconnectObject (const goObjectBase *object)
 Disconnects an object from this object.
 
virtual bool callObjectMethod (int methodID, goObjectMethodParameters *param=NULL)
 Call an object method by identifier. More...
 
virtual bool queueObjectMethod (int methodID, goObjectMethodParameters *param=NULL, bool blocking=false)
 Enqueue a method call to an internal list of methods. More...
 
bool callQueuedMethods ()
 Call all queued methods. More...
 

Additional Inherited Members

- Protected Member Functions inherited from goObjectBase
void setClassID (int id)
 Sets the class name.
 
void printClassMessage (const char *msg)
 Sets the class name. More...
 
void printClassMessage (goString &msg)
 Prints an informational message to the calling console. More...
 
void sendObjectMessage (int messageID, void *data=NULL)
 Sends a message to all connected objects.
 
void sendObjectMessage (goObjectBase *object, int messageID, void *data=NULL)
 Sends a message to a specific object.
 
virtual void receiveObjectMessage (const goObjectMessage &message)
 Receive a message. More...
 

Detailed Description

template<class input_vector, class scalar_type>
class goMath::MultiGaussPDF< input_vector, scalar_type >

Vector values Gauss distribution.

You can use reset(), update(), and updateFlush() to learn a distribution from samples.

See the latex documentation in doc/gogausspdf for details.

Todo:
Normalisation factor.

Member Function Documentation

◆ reset()

template<class input_vector , class scalar_type >
void goMath::MultiGaussPDF< input_vector, scalar_type >::reset ( goSize_t  N = 1)

Resets sample count, covariance matrix, etc., before using update() to learn a distribution from samples.

Parameters
NVector length of samples. You may leave this open, the first update() call will set the sizes then.

◆ update()

template<class input_vector , class scalar_type >
void goMath::MultiGaussPDF< input_vector, scalar_type >::update ( const input_vector &  input)

Update current mean and covariance.

You have to call reset() before starting to learn a distribution with this function. When you are done, you must call updateFlush() to calculate the inverse covariance and the like.

Parameters
inputSample vector.

◆ updateFlush()

template<class input_vector , class scalar_type >
void goMath::MultiGaussPDF< input_vector, scalar_type >::updateFlush ( )

Ending learning from samples.

You must call this function when you are done learning a distribution from samples with update(). Note that you can always call update() after updateFlush(), but in order to use the new, updated distribution, you must call updateFlush() before use.


The documentation for this class was generated from the following files: