qualHighest: Score an empirical density distribution of values, where the...

View source: R/fcn_qualities.R

qualHighestR Documentation

Score an empirical density distribution of values, where the best possible distribution is right-skewed.

Description

The score is computed according to

Usage

qualHighest(x, N)

Arguments

x

Vector of numeric values (e.g. height of histogram bins)

N

Length of x (just a precaution currently)

Details

q = ((N-1) - sum_i( ((N-i-1)*x_i) ) / (N-1)

Scores range from 0 (worst), to 1 (best). E.g. c(0,0,0,16) would yield a score of 1. c(16,0,0,0,0) gives a score of 0.

Value

Quality score in the range of [0,1]

Examples

 qualHighest(c(0,0,0,16), 4)   ## 1
 qualHighest(c(16,0,0,0), 4)   ## 0 
 qualHighest(c(1,1,1,1), 4)    ## 0.5
 qualHighest(c(0,16,0,0), 4)   ## 1/3
 

PTXQC documentation built on Sept. 21, 2022, 9:10 a.m.