- Inherits from:
- Object
- Declared in:
- DScore.h
Object
|
+---DScore
Class Description
The DScore class implements a score in a (discrete) distribution. The score
object is updated with new values and calculates the length, the average or
mean, the variance, the standard deviation, the sum and the squared sum. A
score object is not a collection: the update values are not stored in the
object; the state of the object is updated with the new value.
- Last modified:
- 31-Oct-2007 (DScore.h)
Instance Variables
- private long _length
- the number of values in the object
- private double _min
- the minimum value of the range
- private double _max
- the maximum value of the range
- private double _sum
- the sum of the values
- private double _sumSquared
- the sum of the squared values
- private double _percentage
- the percentage of this score in the distribution (0.0 .. 100.0)
- Constructors
- - (DScore *) init
- Initialise the object with no range
- Returns:
- the object
- - (DScore *) init :(int) value
- Initialise with a discrete value
- Parameters:
- value - the discrete value
- Returns:
- the object
- - (DScore *) init :(double) min :(double) max
- Initialise with a range
- Parameters:
- min - the minimal value of the range
max - the maximum value of the range
- Returns:
- the object
- Member methods
- - (int) length
- Return the number of the values
- Returns:
- the number
- - (double) max
- Return the maximum value
- Returns:
- the maximum value
- - (double) min
- Return the mininal value
- Returns:
- the minimal value
- - (double) percentage
- Return the percentage of this score in the full distribution
- Returns:
- the percentage (0.0 .. 100.0)
- - (double) sum
- Return the sum of the values
- Returns:
- the sum
- - (double) sumSquared
- Return the sum of the squared values
- Returns:
- the sum of the squared values
- Set methods
- - (DScore *) distribution :(long) length
- Set the number of the values in the distribution
- Parameters:
- length - the number of values in the distribution
- Returns:
- the object
- - (BOOL) range :(int) value
- Set the range with a discrete value (only when the length is zero)
- Parameters:
- value - the discrete value
- Returns:
- success
- - (BOOL) range :(double) min :(double) max
- Set the range (only when the length is zero)
- Parameters:
- min - the minimal value
max - the maximal value
- Returns:
- success
- - (DScore *) reset
- Reset the length and sums to zero
- Returns:
- the object
- - (BOOL) update :(double) value
- Update the object with a value
- Parameters:
- value - the update value
- Returns:
- success
- 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
generated 05-Nov-2007 by ObjcDoc 3.0.0