- Inherits from:
- Object
- Declared in:
- DDiscreteDistribution.h
Object
|
+---DDiscreteDistribution
Class Description
The DDiscreteDistribution class implements a (discrete) distribution class.
The distribution object is updated with new values. Its task is to determine
the length, the average or mean, the variance, the standard deviation, the sum
and the squared sum of all values in the distribution. For the scores the length
and percentage of every score can be determined.
The distribution object is not a collection: the values are not stored in the
object; the state of the object is updated with the new value.
- Last modified:
- 31-Oct-2007 (DDiscreteDistribution.h)
Instance Variables
- private long _length
- the number of values in the distribution
- private double _sum
- the sum of the values in the distribution
- private double _sumSquared
- the sum of the squared values in the distribution
- private DList *_scores
- the list with the scores
- Constructors
- - (DDiscreteDistribution *) init
- Initialise the object with no range
- Returns:
- the object
- Copy related method
- - shallowCopy
- Do a shallow copy of the distribution object (not implemented)
- Returns:
- the object
- Destructor
- - free
- Free the distribution
- Returns:
- the object
- Member methods
- - (int) length
- Return the number of the values in the distribution
- Returns:
- the number
- - (double) sum
- Return the sum of the values in the distribution
- Returns:
- the sum
- - (double) sumSquared
- Return the sum of the squared values in the distribution
- Returns:
- the sum of the squared values
- Set methods
- - (BOOL) range :(int) value
- Add a score with a (discrete) range to the distribution: [val-0.5,val+0.5>
- Parameters:
- value - the discrete value for the range
- Returns:
- success
- - (BOOL) range :(double) min :(double) max
- Add a score with a range to the distribution: [min,max>
- Parameters:
- min - the minimum value for the range
max - the maximum value for the range
- Returns:
- success
- - (DDiscreteDistribution *) reset
- Reset the length, sums and scores to zero
- Returns:
- the object
- - (BOOL) update :(double) value
- Update the distribution with a value
- Parameters:
- value - the update value
- Returns:
- success (is a score updated?)
- Distribution Calculation methods
- - (double) average
- Calculate the average of the values
- Returns:
- the average value
- - (double) mean
- Calculate the mean of the values
- Returns:
- the mean value
- - (double) standardDeviation
- Calculate the standard deviation of the values
- Returns:
- the standard deviation
- - (double) variance
- Calculate the variance of the values
- Returns:
- the variance
- Score methods
- - (DListIterator *) scores
- Return an iterator on the scores in the distribution
- Returns:
- a (new) iterator on the list of the DScore objects
generated 05-Nov-2007 by ObjcDoc 3.0.0