GClasses
GClasses::GUniformDistribution Class Reference

Detailed Description

This is a continuous uniform distribution.

#include <GDistribution.h>

Inheritance diagram for GClasses::GUniformDistribution:
GClasses::GUnivariateDistribution GClasses::GDistribution

Public Member Functions

 GUniformDistribution ()
 
virtual ~GUniformDistribution ()
 
virtual bool isDiscrete () const
 Returns false. More...
 
virtual bool isSupported (double x) const
 Returns true iff a <= x < b. 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 middle value (which is also the median and one of the modes) More...
 
virtual double mode () const
 Returns the middle value (which is also the mean and median) More...
 
void setParams (double a, double b)
 Set the parameters of this distribution. More...
 
virtual Type type () const
 Returns the type of distribution. More...
 
- Public Member Functions inherited from GClasses::GUnivariateDistribution
 GUnivariateDistribution ()
 
virtual ~GUnivariateDistribution ()
 

Protected Attributes

double m_a
 
double m_b
 

Additional Inherited Members

- Public Types inherited from GClasses::GUnivariateDistribution

Constructor & Destructor Documentation

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

Member Function Documentation

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

Returns false.

Implements GClasses::GUnivariateDistribution.

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

Returns true iff a <= x < b.

Implements GClasses::GUnivariateDistribution.

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

Returns the middle value (which is also the median and one of the modes)

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

Returns the middle value (which is also the mean and median)

Implements GClasses::GUnivariateDistribution.

void GClasses::GUniformDistribution::setParams ( double  a,
double  b 
)
inline

Set the parameters of this distribution.

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

Returns the type of distribution.

Implements GClasses::GUnivariateDistribution.

Member Data Documentation

double GClasses::GUniformDistribution::m_a
protected
double GClasses::GUniformDistribution::m_b
protected