Logarithmic Scales
briefer.cloud
briefer.cloud
https://leeoniya.github.io/uPlot/demos/arcsinh-scales.html
cube root: https://en.wikipedia.org/wiki/Cube_root#/media/File:Cube-roo...
vs arcsinh: https://upload.wikimedia.org/wikipedia/commons/9/92/Inverse_...
some interactive log scale demos:
you can always y-flip the result of log(abs(value)) and show neg ticks on the axis, but it will not be a nicely-continuous, single scale that can cross 0.
https://stackoverflow.com/questions/3305865/what-is-the-diff...
https://matplotlib.org/stable/gallery/scales/symlog_demo.htm...
for an example.
how does this actually work? afaik, there is no log() fn that you can run which "becomes linear". i guess you can wrap a call to log() in another fn that simply does linear scaling below the defined threshold, but it's not a smooth transition without a bunch of extra [possibly slow] smoothing code.
what you're describing is exactly how a straight call to Math.asinh() behaves, and what i have implemented in the above demo.
In the example from matplotlib I linked in the earlier comment they call out that the symlog transform has a discontinous gradient at the a's, and that the asinh transform can be used instead if that's a problem.
Edit: On reflection it's probably not entirely correct to talk about it as choosing an appropriate c. Since that transform seems to kinda break apart around a=1. Simpler to consider it a matter of plotting on a logarithmic scale down to some value. Then continuing the plot on a linear scale until you reach the negative value on the other side and then plotting on a negative logarithmic scale (-log(|x|)).
All in all, for scientists the symlog is much more useful.
asinh also has log scaling beyond this threshold. https://specialfunctionswiki.org/index.php/Arcsinh
It's a great transformation for data viz or machine learning / statistical modeling, but its not really obvious what an IHS-transformed variable represents.
once you see the shape plotted, i dont think it's much harder than understanding the shape of logistic functions, which have similar formulations, and are used all over the place in ai/ml for activation, etc.
There are even wilder triple hyperbolic scales on three dimensions.
https://win-vector.com/2012/03/01/modeling-trick-the-signed-...
https://marcfbellemare.com/wordpress/12856
https://worthwhile.typepad.com/worthwhile_canadian_initi/201...
https://www.nber.org/system/files/working_papers/w29998/w299...
https://blogs.worldbank.org/en/impactevaluations/interpretin...
https://academic.oup.com/ectj/article-abstract/24/2/334/5948...
https://marcfbellemare.com/wordpress/wp-content/uploads/2019...
I don't exactly know what I am doing when I venture into Javascript and web stuff but here you go:
https://github.com/EngineersNeedArt/SlideRule
There's a demo page off the link above. It's a janky Ohm's Law calculator. (The top slider & text field are read-only, BTW.)
For example, if an operation usually takes around 20ms, I would want to know if that operation suddenly took 200ms (a factor of 10). But I wouldn't be interested in small deviations; 40ms, even if it's twice the original number, is this within the natural variance seen due to varying levels of load and so on. Conversely, if an operation normally takes 5,000ms, if it took 10s that would actually be terrible, and I really want to know if it exceeded, say, 6,000ms. In other words, the acceptable deviation is dependent on the scale of the original number.
So I ended up choosing a hand-tuned logarithmic function which multiplies the average with a constant divided by the logarithm of the average, the output being the upper bounds on how much deviation from the average we can tolerate. So the larger the number, the lower the tolerance in absolute (linear terms).
It doesn’t matter what the log base is.
0 on the scale will correspond to 1, and 1 will correspond to the base. The shape of the curves will be identical regardless of what you choose as a base, only the labels on the scale will change and generally what you really care about with a log scale is less the values that come out than the shape of the curve.
A quick way to check if something grows linearly is to put it on a log-scale and to see whether it’s a straight line.
Nice explanation, though. We should talk about logs more often.
If something is a straight line when you plot it in log scale, you are plotting exponential growth.
Multiplicative growth by a constant factor is an increasing rate of change over time.
Viewed like this, the fact that it uses inches vs m isn't significant, because 'inches' translates as 'units'. Even as a Brit, I can't imagine 1000 inches either, but I can tell something about two objects that are respectively 1000 vs 1200 inches/units.
Or converting to meters: 100 ft / 3 = 33 yards ~ 33 meters.
Since we added 20% in the first place (1200 vs 1000), 33 - 20% = 27m is better estimate (actual = 25m).