The cumulative sum of all negative deviations.

negative_deviation(data_vector, reference_vector)

Arguments

data_vector

Numeric data vector

reference_vector

Corresponding data of the reference

Value

Numeric value between 0 and 1

Details

First the similarity the data vector and the reference vector is calculated. Only complete pairs (no NA values) are used. For each data pair the quotient between data and reference is calcutaled. If data > reference the value is set to 1. All quotients are cumulated (-> absolute similarity). This can be maximum the number of data pairs. When deviding by the number of data pairs, the relative similarity is obtained. One minus the relative similarity is the negative deviation.