Wow. This is the first time in hearing about the inverse hyperbolic sine scale. I wonder if it's lesser known simply because many kinds of real-world underlying data that needs logarithmic scales simply don't have zeroes or negative values? For example we might be plotting some data that actually comes from an underlying exponential distribution?
i think sometimes it's called symlog, though i'm not sure if that's just a convenient re-naming of arcsinh. i don't see how any kind of "log" scale can do <= 0.
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.
Symlog is symmetric log. It's not arcsinh, instead it's a normal logarithmic scale, that turns into a linear scale around zero (for example in the range [-1,1]) and then it turns into a negative logarithm on the other side of zero. So similar but slightly different.
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.
Theres no smoothing involved, it's three distinct domains with different function definitions. Top part is log(x) from [a,\infty), bottom part is -log(-x) from (-\infty,-a] and the middle part is cx from (-a,a). With c chosen to ensure continuity in the transform.
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|)).
As the other commenter pointed out, symlog is not smooth. But the point about symlog is that it is very simple, has the familiar and intuitive log scaling, and most importantly that you can select the point where it transitions to linear such that it is below the smallest scale you care about.
All in all, for scientists the symlog is much more useful.
It's also harder to interpret. What the heck does `log(x + sqrt(x^2 + 1))` mean?
It's a great transformation for data viz or machine learning / statistical modeling, but its not really obvious what an IHS-transformed variable represents.
> It's also harder to interpret. What the heck does `log(x + sqrt(x^2 + 1))` mean?
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.
It's not hard to see that it's sigmoidal, sure. But both the logistic function and the logarithm itself have a lot of nice mathematical properties that are useful for qualitatively interpretation. I'm not aware of equivalent nice properties for the inverse hyperbolic sine, other than those that arise from it being a logarithm of something, but it's not a logarithm of anything particularly meaningful.