Description
The byte efficiency audits use a secoring functions that is defined by linear interpolation between three control points: {0, p_avg, p_poor, p_zero}
, the positions between which are defined by linear interpolation between the points. Here is the curve from byte-efficiency-audit.js with control points={0, 300, 750, 5000}
, forming what looks like an approximation of a convex curve:
Having such a piecewise function is undesirable for two resons: (1) It complicates the code (2) it can increase variance when measures values lie close to the control points.
Choosing p10=90, median=700
this curve can be approximated using the standard log normal distribution. These values where chosen manually using the sliders. The error is biggest towards the lower end of the scores. The parameters could be chosen methodically by using a function fitting tool like the one from gnuplot.
If using the control points is desirable for some reason, another, smooth interpolation method could be used (e.g. cubic, finding a spline, …).
Here's the desmos functions I've used if you would like to play around.
$
g\left(x_{0},y_{0},x_{1},y_{1},x\right)=y_{0}+\left(x-x_{0}\right)\cdot\frac{y_{1}-y_{0}}{x_{1}-x_{0}}
p_{0}=5000
p_{poor}=750
p_{avg}=300
l\left(x\right)=\left{0<x<p_{avg}:g\left(0,1,p_{avg},0.75,x\right),p_{avg}<x<p_{poor}:g\left(p_{avg},0.75,p_{poor},0.5,x\right),p_{poor}<x<p_{0}\ :g\left(p_{poor},0.5,p_{0},0,x\right)\right}
$
Pity gfm doesn't support math mode.
Also merry christmas :)