Class implements Uniform Distribution. More...

#include <uniformDistribution.hpp>

Inheritance diagram for julian::UniformDistribution:
julian::ScaleLocationDistribution julian::ProbabilityDistribution

Public Member Functions

 UniformDistribution ()
 Constructor. More...
 
 UniformDistribution (double A, double B)
 Constructor. More...
 
UniformDistributionclone () const
 Virtual copy constructor. More...
 
Probability Distribution Interface
double CDF (double)
 calculates value of Cumulative Distribution Function More...
 
double PDF (double)
 calculates value of Probability Distribution Function More...
 
double invCDF (double)
 calculates quantile More...
 
double mean ()
 returns mean More...
 
double variance ()
 returns variance More...
 
void estimate (std::vector< double >)
 estimates parameters using Moment Matching Estimation More...
 
Scale Location Interface
double getLocation ()
 returns location More...
 
double getScale ()
 returns location More...
 
double getShape ()
 returns shape More...
 
void setLocation (double)
 sets location More...
 
void setScale (double)
 sets scale parameter More...
 
void setShape (double)
 This method does nothing. More...
 
- Public Member Functions inherited from julian::ScaleLocationDistribution
virtual ~ScaleLocationDistribution ()
 destructor More...
 
- Public Member Functions inherited from julian::ProbabilityDistribution
virtual ~ProbabilityDistribution ()
 destructor More...
 

Private Attributes

double A_
 Minimum value (location parameter) More...
 
double B_
 Maximum value (scale parameter) More...
 

Detailed Description

Class implements Uniform Distribution.

Uniform probability distribution is defined by the two parameters, A and B, which are its minimum and maximum values.

1) Cumulative distribution function of normal random variable X

\[CDF_{X}(x) = \begin{cases} 0 & \quad \text{if } x < A \\ \frac{x-A}{B-A} & \quad \text{if } x \in [A,B) \\ 1 & \quad \text{if } x > B \end{cases} \]

2) Probability distribution function of normal random variable X

\[PDF_{X}(t) = \begin{cases} \frac{1}{B-A} \quad \text{if } x \in [A,B] \\ 0 \quad \text{ otherwise} \end{cases}\]

3) Parameters

A is minimum value

B is maximum value

Location

A is a location parameter.

Scale

Scale is difference of B and A

Examples:
simulatedAnnealingExample.cpp.

Constructor & Destructor Documentation

julian::UniformDistribution::UniformDistribution ( )
inline

Constructor.

Set location to 0 and scale to 1

julian::UniformDistribution::UniformDistribution ( double  A,
double  B 
)

Constructor.

Constructor requires parametrization of random variables

Member Function Documentation

double julian::UniformDistribution::CDF ( double  x)
virtual

calculates value of Cumulative Distribution Function

\[CDF_{X}(x) = \begin{cases} 0 & \quad \text{if } x < A \\ \frac{x-A}{B-A} & \quad \text{if } x \in [A,B) \\ 1 & \quad \text{if } x > B \end{cases} \]

Implements julian::ProbabilityDistribution.

UniformDistribution * julian::UniformDistribution::clone ( ) const
virtual

Virtual copy constructor.

Reimplemented from julian::ScaleLocationDistribution.

void julian::UniformDistribution::estimate ( std::vector< double >  data)
virtual

estimates parameters using Moment Matching Estimation

\[\begin{array}{rcr} a & = \hat{\mu} - \sqrt{3}*\hat{\sigma} \\ b & = \hat{\mu} + \sqrt{3}*\hat{\sigma} \end{array}\]

Implements julian::ProbabilityDistribution.

double julian::UniformDistribution::getLocation ( )
virtual

returns location

Implements julian::ScaleLocationDistribution.

double julian::UniformDistribution::getScale ( )
virtual

returns location

Implements julian::ScaleLocationDistribution.

double julian::UniformDistribution::getShape ( )
virtual

returns shape

Method returns NAN as uniform distribution is not parametrized with shape

Implements julian::ScaleLocationDistribution.

double julian::UniformDistribution::invCDF ( double  p)
virtual

calculates quantile

Implements julian::ProbabilityDistribution.

double julian::UniformDistribution::mean ( )
virtual

returns mean

Implements julian::ProbabilityDistribution.

double julian::UniformDistribution::PDF ( double  x)
virtual

calculates value of Probability Distribution Function

\[CDF_{X}(x) = \begin{cases} 0 & \quad \text{if } x < A \\ \frac{x-A}{B-A} & \quad \text{if } x \in [A,B) \\ 1 & \quad \text{if } x > B \end{cases} \]

Implements julian::ProbabilityDistribution.

void julian::UniformDistribution::setLocation ( double  l)
virtual

sets location

Parameter A is location of uniform distribution

Implements julian::ScaleLocationDistribution.

void julian::UniformDistribution::setScale ( double  )
virtual

sets scale parameter

Implements julian::ScaleLocationDistribution.

void julian::UniformDistribution::setShape ( double  )
virtual

This method does nothing.

uniform distribution is not parametrized by shape parameter

Implements julian::ScaleLocationDistribution.

double julian::UniformDistribution::variance ( )
virtual

returns variance

Implements julian::ProbabilityDistribution.

Member Data Documentation

double julian::UniformDistribution::A_
private

Minimum value (location parameter)

double julian::UniformDistribution::B_
private

Maximum value (scale parameter)


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/mathematics/distributions/uniformDistribution.hpp
  • C:/Unix/home/OEM/jULIAN/src/mathematics/distributions/uniformDistribution.cpp