GClasses
GClasses::GNormalDistribution Class Reference

Detailed Description

This is the Normal (a.k.a. Gaussian) distribution.

#include <GDistribution.h>

Inheritance diagram for GClasses::GNormalDistribution:
GClasses::GUnivariateDistribution GClasses::GDistribution

Public Member Functions

 GNormalDistribution ()
 
virtual ~GNormalDistribution ()
 
virtual bool isDiscrete () const
 Returns false. More...
 
virtual bool isSupported (double x) const
 Returns true for all values. More...
 
virtual double likelihood (double x)
 See the comment for GUnivariateDistribution::likelihood. More...
 
virtual double logLikelihood (double x)
 See the comment for GUnivariateDistribution::logLikelihood. More...
 
double mean () const
 Returns the mean. More...
 
virtual double mode () const
 Returns the mode (which is also the mean) More...
 
double modeLikelihood ()
 Returns the probability density (height) of the mode (mode=mean for a normal distribution) More...
 
void multiply (GNormalDistribution *pOther)
 Multiplies this by another Normal distribution. More...
 
void setMeanAndVariance (double newmean, double newvariance)
 Sets the mean and variance of this distribution. More...
 
virtual Type type () const
 Returns the type of distribution. More...
 
double variance () const
 Returns the variance. More...
 
- Public Member Functions inherited from GClasses::GUnivariateDistribution
 GUnivariateDistribution ()
 
virtual ~GUnivariateDistribution ()
 

Protected Member Functions

void precompute ()
 

Protected Attributes

double m_height
 
double m_mean
 
double m_variance
 

Additional Inherited Members

- Public Types inherited from GClasses::GUnivariateDistribution

Constructor & Destructor Documentation

GClasses::GNormalDistribution::GNormalDistribution ( )
inline
virtual GClasses::GNormalDistribution::~GNormalDistribution ( )
inlinevirtual

Member Function Documentation

virtual bool GClasses::GNormalDistribution::isDiscrete ( ) const
inlinevirtual

Returns false.

Implements GClasses::GUnivariateDistribution.

virtual bool GClasses::GNormalDistribution::isSupported ( double  x) const
inlinevirtual

Returns true for all values.

Implements GClasses::GUnivariateDistribution.

virtual double GClasses::GNormalDistribution::likelihood ( double  x)
inlinevirtual
virtual double GClasses::GNormalDistribution::logLikelihood ( double  x)
inlinevirtual
double GClasses::GNormalDistribution::mean ( ) const
inline

Returns the mean.

virtual double GClasses::GNormalDistribution::mode ( ) const
inlinevirtual

Returns the mode (which is also the mean)

Implements GClasses::GUnivariateDistribution.

double GClasses::GNormalDistribution::modeLikelihood ( )
inline

Returns the probability density (height) of the mode (mode=mean for a normal distribution)

void GClasses::GNormalDistribution::multiply ( GNormalDistribution pOther)
inline

Multiplies this by another Normal distribution.

void GClasses::GNormalDistribution::precompute ( )
protected
void GClasses::GNormalDistribution::setMeanAndVariance ( double  newmean,
double  newvariance 
)
inline

Sets the mean and variance of this distribution.

virtual Type GClasses::GNormalDistribution::type ( ) const
inlinevirtual

Returns the type of distribution.

Implements GClasses::GUnivariateDistribution.

double GClasses::GNormalDistribution::variance ( ) const
inline

Returns the variance.

Member Data Documentation

double GClasses::GNormalDistribution::m_height
protected
double GClasses::GNormalDistribution::m_mean
protected
double GClasses::GNormalDistribution::m_variance
protected