NZTA\SDLT\Formulae\NztaApproxRepresentation
The "NztaApproxRepresentation" subclass of {@link RiskFormula}, a formula used in base impact rating calculations.
To calculate the base impact rating, use the following formula:
- Average and Median weightings are calculated from the dataset
- Highest weightings are removed
- Formula: Highest weighting + (((3 * mean) + (2 * median)) * 0.25)
Synopsis
class NztaApproxRepresentation
extends RiskFormula
{
- // constants
- const MEAN_LHS_OPERAND = 3;
- const MEDIAN_LHS_OPERAND = 2;
- const MULTIPLIER = 0.25;
- const PRECISION = 2;
- // Inherited members from RiskFormula
- protected array $weightings;
- // methods
- public mixed calculate()
- public mixed mean()
- public mixed median()
- public mixed highest()
- private array normalise()
- // Inherited methods from RiskFormula
- public abstract mixed calculate()
- public RiskFormula setWeightings()
Hierarchy
Extends
Constants
Name | Value |
---|---|
MEAN_LHS_OPERAND | 3 |
MEDIAN_LHS_OPERAND | 2 |
MULTIPLIER | 0.25 |
PRECISION | 2 |
Members
protected
- $weightings — array
Methods
private
public
- calculate() — Perform an implementation-specific calculation.
- highest() — Return the highest value of an array of numbers of any kind.
- mean() — Return the average value of an array of numbers of any kind.
- median() — Return the median value of an array of integers. Will deal with multiple median value scenarios such as: 1,2,3,3,4,5 as well as various zero-value situations.
Inherited from NZTA\SDLT\Formulae\RiskFormula
public
- calculate() — Perform an implementation-specific calculation.
- setWeightings()