Reputation: 4373
The goal is to convert/normalize raw values on a continuous scale [0-inf] to another continuous scale (score) with range [0-5].
I am using an older study that uses the following approach that I try to reverse engineer:
the equation to convert a raw_value into a score is:
=MAX(0,MIN(5,(LN(raw_value)-LN(0.1))/LN(2) +1))
which means that values are logarithmic interpolated.
So a value of 0.125 corresponds to 1.32 and a value of 0.95 corresponds to 4.25 etc.
The objective is to update the thresholds [0.1,0.2,0.4,0.8]
to new thresholds:
[0.05,0.25,0.5,0.75]
in other words, values between 0.25 and 0.5 should correspond to scores between 2.x and 3.x.
It looks so simple but I am stuck at something like:
=MAX(0,MIN(5,(LN(raw_value)-LN(0.05))/LN(?) +1))
is it even possible to come up with a single equation (No If statements) for the new thresholds since they are a non-logarithmic sequence?
Upvotes: 0
Views: 276
Reputation: 442
Well, your problem is that actually your scale is clamping at its border, so it is in fact not linear.
and
Using this formula, you are not doing a bijection from to ... and thus you need your min/max clamping.
Also, please note that your equation is not defined for r=0 ...
You could do something about the lower bound, by using r+1 instead of r in your log, this way, for r=0, ln(r+1)=ln(1)=0
now for the higher bound, unfortunately, using a simple ln scale, you will still aim at . To deal with this, you will need to clamp your input range, and normalize the input by the range.
Upvotes: 1