Learn R Programming

PTXQC (version 1.0.4)

qualHighest: 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)

Value

Quality score in the range of [0,1]

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.

Examples

Run this code
# NOT RUN {
 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
 
# }

Run the code above in your browser using DataLab