Logarithmic Scales

  • another nice one is Inverse Hyperbolic Sine scale, which can reach 0 and plot negative values, whereas log scales cannot. imo it's nicer than a cube root scale, too.

    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:

    https://leeoniya.github.io/uPlot/demos/log-scales.html

    https://leeoniya.github.io/uPlot/demos/log-scales2.html

  • Very natural also in money/investing applications. Passing to log scale asset prices follow random walks in several finance applications and behave much better in this scale. Options price formulas by rote memory are a bit of a mess because one does a log-calculate-exp kind of thing that distorts the streamlined rationale of the inner simpler calculations. Geometric means (used in CAGR, compound aggregate growth rates, for yearly returns) become just means (=arithmetic means) in log scale.

  • It doesn't really matter what log base you use, visually speaking. All log bases are just multiplicative differences from one another: it's like asking whether it matters if you plot height using feet or meters. It just affects where your ticks go.

  • I tried to create a logarithmic widget for the web for anyone to grab. I like logarithmic interfaces — think there are probably a lot of uses for them.

    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.)

  • As a developer I rarely find the need for log scale, but I was recently analyzing performance data, specifically finding patterns where one operation deviated from the normal.

    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).

  • Since it is on topic - sharing useful link I have in my bookmarks about transformations in general: http://fmwww.bc.edu/repec/bocode/t/transint.html

  • The note at the end about different log bases was confused and borderline nonsensical.

    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.

  • The graph named “non-linear growth”, is actually showing linear growth. I know, it’s confusing, but as long as the factor is constant (10), growth is linear.

    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.

  • No one will see this because I'm shadowbanned but I've always been confused about exponential vs logarithmic. In the authors example about the ruler i'd have thought this was an example of exponential scale in play.

  • Nice read. (Any chance you could add an RSS feed or similar?)

  • would have been a great article if used metric. I cant imaine what 100 inches is, let alone 1000 inches