Weighted Sum Index
Purpose
To calculate a weighted sum based on a set of values and weights.The weighted sum is a dot-product of a set of values and weights.
Type Name
‘weighted_sum’
Definition Syntax
‘[param1|param2] : [weight1|weight2]’
where:
- ‘param1|param2’ denote the pipe-delimited list of keys mapping to values in the value dictionary.
- ‘weight1|weight2’ denote the pipe-delimited list of weights (values between 0 and 1) to use in the calculation. Weights should add up to 1.0 but if they do not, JCass will automatically adjust the weights (see note below).
Note that currently the values you supply for weights must be numeric values. These values can not be keys mapping to values in the value dictionary. This constraint will be removed in future upgrades if requested by users.
Example
‘par_lt_cracks_pct|par_mesh_cracks_pct|par_shoving_pct|par_potholes_pct : 0.2|0.3|0.3|0.2’
This setup code will create a JFunction that will take the values mapped to keys:
- par_lt_cracks_pct (% longitudinal and transverse cracks)
- par_mesh_cracks_pct (% mesh cracks, i.e. ‘crocodile’ cracks)
- par_shoving_pct (% shoving)
- par_potholes_pct (% potholes)
in the value dictionary and then calculate a Weighted Sum using weights 0.2, 0.3, 0.3 and 0.2.
If the weights you provide (or that are calculated in the case where weights are themselves outputs of other JFunctions) do not add up to 1.0, a proportional adjustment will be made to ensure that the weights add up to 1.0. This adjustment will be done before the Weighted Sum is calculated.