Main Page | Namespace List | Class Hierarchy | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

CLUS::MultiDimNormal Class Reference

Implements a multidimentional normal distribution. More...

#include <multinormal.h>

Inheritance diagram for CLUS::MultiDimNormal:

Inheritance graph
[legend]
Collaboration diagram for CLUS::MultiDimNormal:

Collaboration graph
[legend]

Public Member Functions

 MultiDimNormal (int InDim=0)
 MultiDimNormal (int InDim, int)
 MultiDimNormal (int InDim, double Alpha, Vector< double > &Mu, Fortran_Matrix< double > &SigmaChol)
RegressorCreateRegressor (void)
 Creates a class that can do the regression for this distribution if given the input.

void DenormalizeParameters (MultiDimNormal *pD)
 Reverses the normalization transformation in the original space mu=pD.sigmaChol*mu+pD.mu; sigmaChol=pD.sigmaChol*sigmaChol;.

void NormalizeData (const double *DataCache, double *X)
 Transform data such that it looks like a 0 centered sphere of radius 1.

double LearnProbability (const double *DataCache)
 Probability that a point belongs to this distribution at learning, unnormalized.

double InferProbability (const double *DataCache)
 Probability that a point belongs to this distribution at inference, unnormalized.

void UpdateStatistics (const double *DataCache, double prob)
double NormalizeLearnProbability (double Coef, int nrClus=1)
 Normalizes the probability of belonging to this cluster, normalizing over the mixture Coef is sum alpha*P(x|distribution).

double UpdateParameters (void)
 Computes the values of the new parameters from sufficient statistics.

void AdjustYwithYoverD (double &y)
 Computes the output value for the distribution*probab.

void RandomDistribution (int NrClusters)
 Random initialization of a distribution.

void RandomDistribution (int NrClusters, MultiDimNormal &parent)
 For hierarchies or trees we need to produce offsprings close to the parent.

void SaveToStream (ostream &out)
 Saves the state of the Distribution in a stream.

void LoadFromStream (istream &in)
 Loads the state of the Distribution in a stream.


Static Public Member Functions

string TypeName (void)

Protected Member Functions

void ComputeAlphas (void)
 Computes alpha_over_detChol_inDimp1 and alpha_over_detChol_inDim given sigmaChol.

bool ComputeCCoef (Fortran_Matrix< double > &Sigma, bool isCholesky)
 Computes the equation of the hyperplane using Sigma=S_xxT.


Protected Attributes

Vector< double > mu
 the expected value

Vector< double > C
 the equation of the hyperplane

Fortran_Matrix< double > sigmaChol
 the covariance matrix's cholesky, upper diagonal lower diagonal

double alpha_over_detChol_inDimp1
 the determinant of the cholesky factor of Sigma

double alpha_over_detChol_inDim
int N
 number of datapoints

double S
 sum probabilities

Vector< double > S_x
 sum probab*x

Fortran_Matrix< double > S_xxT
 sum prob*xx^T, upper symm diag

double radius
 the radius of the distribution. Used to generate distributions close by


Detailed Description

Implements a multidimentional normal distribution.

Definition at line 52 of file multinormal.h.


Constructor & Destructor Documentation

CLUS::MultiDimNormal::MultiDimNormal int  InDim = 0  )  [inline]
 

Definition at line 213 of file multinormal.h.

CLUS::MultiDimNormal::MultiDimNormal int  InDim,
int 
[inline]
 

Definition at line 225 of file multinormal.h.

CLUS::MultiDimNormal::MultiDimNormal int  InDim,
double  Alpha,
Vector< double > &  Mu,
Fortran_Matrix< double > &  SigmaChol
[inline]
 

Definition at line 237 of file multinormal.h.


Member Function Documentation

void CLUS::MultiDimNormal::AdjustYwithYoverD double &  y  )  [inline]
 

Computes the output value for the distribution*probab.

Reimplemented from CLUS::Distribution.

Definition at line 485 of file multinormal.h.

void CLUS::MultiDimNormal::ComputeAlphas void   )  [inline, protected]
 

Computes alpha_over_detChol_inDimp1 and alpha_over_detChol_inDim given sigmaChol.

Definition at line 85 of file multinormal.h.

Referenced by LoadFromStream(), MultiDimNormal(), RandomDistribution(), and UpdateParameters().

bool CLUS::MultiDimNormal::ComputeCCoef Fortran_Matrix< double > &  Sigma,
bool  isCholesky
[inline, protected]
 

Computes the equation of the hyperplane using Sigma=S_xxT.

Must be called when S_xxT contains Sigma not the partial sums only.

Returns:
true if anything is fine, false if something is wrong and the computation is bogus.

Definition at line 107 of file multinormal.h.

Referenced by CreateRegressor(), and LoadFromStream().

Regressor* CLUS::MultiDimNormal::CreateRegressor void   )  [inline]
 

Creates a class that can do the regression for this distribution if given the input.

Reimplemented from CLUS::Distribution.

Definition at line 248 of file multinormal.h.

void CLUS::MultiDimNormal::DenormalizeParameters MultiDimNormal pD  )  [inline]
 

Reverses the normalization transformation in the original space mu=pD.sigmaChol*mu+pD.mu; sigmaChol=pD.sigmaChol*sigmaChol;.

Definition at line 260 of file multinormal.h.

double CLUS::MultiDimNormal::InferProbability const double *  DataCache  )  [inline]
 

Probability that a point belongs to this distribution at inference, unnormalized.

Reimplemented from CLUS::Distribution.

Definition at line 344 of file multinormal.h.

double CLUS::MultiDimNormal::LearnProbability const double *  DataCache  )  [inline]
 

Probability that a point belongs to this distribution at learning, unnormalized.

Reimplemented from CLUS::Distribution.

Definition at line 304 of file multinormal.h.

void CLUS::MultiDimNormal::LoadFromStream istream &  in  )  [inline]
 

Loads the state of the Distribution in a stream.

Reimplemented from CLUS::Distribution.

Definition at line 584 of file multinormal.h.

void CLUS::MultiDimNormal::NormalizeData const double *  DataCache,
double *  X
[inline]
 

Transform data such that it looks like a 0 centered sphere of radius 1.

Reimplemented from CLUS::Distribution.

Definition at line 287 of file multinormal.h.

double CLUS::MultiDimNormal::NormalizeLearnProbability double  Coef,
int  nrClus = 1
[inline]
 

Normalizes the probability of belonging to this cluster, normalizing over the mixture Coef is sum alpha*P(x|distribution).

Reimplemented from CLUS::Distribution.

Definition at line 384 of file multinormal.h.

void CLUS::MultiDimNormal::RandomDistribution int  NrClusters,
MultiDimNormal parent
[inline]
 

For hierarchies or trees we need to produce offsprings close to the parent.

Definition at line 541 of file multinormal.h.

void CLUS::MultiDimNormal::RandomDistribution int  NrClusters  )  [inline]
 

Random initialization of a distribution.

Reimplemented from CLUS::Distribution.

Definition at line 499 of file multinormal.h.

void CLUS::MultiDimNormal::SaveToStream ostream &  out  )  [inline]
 

Saves the state of the Distribution in a stream.

Reimplemented from CLUS::Distribution.

Definition at line 567 of file multinormal.h.

string CLUS::MultiDimNormal::TypeName void   )  [inline, static]
 

Reimplemented from CLUS::Distribution.

Definition at line 494 of file multinormal.h.

double CLUS::MultiDimNormal::UpdateParameters void   )  [inline]
 

Computes the values of the new parameters from sufficient statistics.

Reimplemented from CLUS::Distribution.

Definition at line 394 of file multinormal.h.

void CLUS::MultiDimNormal::UpdateStatistics const double *  DataCache,
double  prob
[inline]
 

Definition at line 370 of file multinormal.h.

Referenced by NormalizeLearnProbability().


Field Documentation

double CLUS::MultiDimNormal::alpha_over_detChol_inDim [protected]
 

Definition at line 67 of file multinormal.h.

Referenced by ComputeAlphas(), InferProbability(), and MultiDimNormal().

double CLUS::MultiDimNormal::alpha_over_detChol_inDimp1 [protected]
 

the determinant of the cholesky factor of Sigma

Definition at line 66 of file multinormal.h.

Referenced by ComputeAlphas(), LearnProbability(), and MultiDimNormal().

Vector<double> CLUS::MultiDimNormal::C [protected]
 

the equation of the hyperplane

Definition at line 59 of file multinormal.h.

Referenced by AdjustYwithYoverD(), ComputeCCoef(), CreateRegressor(), MultiDimNormal(), and RandomDistribution().

Vector<double> CLUS::MultiDimNormal::mu [protected]
 

the expected value

Definition at line 56 of file multinormal.h.

Referenced by ComputeAlphas(), ComputeCCoef(), DenormalizeParameters(), InferProbability(), LearnProbability(), LoadFromStream(), MultiDimNormal(), NormalizeData(), RandomDistribution(), SaveToStream(), and UpdateParameters().

int CLUS::MultiDimNormal::N [protected]
 

number of datapoints

Definition at line 70 of file multinormal.h.

Referenced by MultiDimNormal(), UpdateParameters(), and UpdateStatistics().

double CLUS::MultiDimNormal::radius [protected]
 

the radius of the distribution. Used to generate distributions close by

Definition at line 82 of file multinormal.h.

Referenced by ComputeCCoef(), and RandomDistribution().

double CLUS::MultiDimNormal::S [protected]
 

sum probabilities

Definition at line 73 of file multinormal.h.

Referenced by ComputeCCoef(), MultiDimNormal(), UpdateParameters(), and UpdateStatistics().

Vector<double> CLUS::MultiDimNormal::S_x [protected]
 

sum probab*x

Definition at line 76 of file multinormal.h.

Referenced by MultiDimNormal(), UpdateParameters(), and UpdateStatistics().

Fortran_Matrix<double> CLUS::MultiDimNormal::S_xxT [protected]
 

sum prob*xx^T, upper symm diag

Definition at line 79 of file multinormal.h.

Referenced by ComputeAlphas(), MultiDimNormal(), UpdateParameters(), and UpdateStatistics().

Fortran_Matrix<double> CLUS::MultiDimNormal::sigmaChol [protected]
 

the covariance matrix's cholesky, upper diagonal lower diagonal

Definition at line 63 of file multinormal.h.

Referenced by ComputeAlphas(), CreateRegressor(), DenormalizeParameters(), InferProbability(), LearnProbability(), LoadFromStream(), MultiDimNormal(), NormalizeData(), RandomDistribution(), SaveToStream(), and UpdateParameters().


The documentation for this class was generated from the following file:
Generated on Mon Jul 21 16:57:51 2003 for SECRET by doxygen 1.3.2