AI Glossary / Time series and signal processing / Intermediate

Logarithmic transformation

Definition

A logarithmic transformation replaces positive values with their logarithms. It converts multiplicative relationships into additive ones and compresses large values relative to small values. In time-series modeling, it can help represent proportional changes or stabilize variation that grows with the level. Its usefulness depends on the data and the modeling objective.

What it means

On the original scale, moving from 10 to 20 adds ten, while moving from 100 to 200 adds one hundred. Both changes double the quantity. On a logarithmic scale, these two proportional changes have the same size.
A transformation changes the scale on which patterns and errors are modeled. It does not remove uncertainty, guarantee normality, or make an inappropriate forecasting model correct. Returning predictions to the original scale also requires care about which summary of the forecast distribution is wanted.

How it works

Choose a logarithm base and apply it consistently to positive measurements. Natural logarithms, written ln, are common in statistical modeling; their inverse is the exponential function. The identity ln(ab) = ln(a) + ln(b) turns multiplicative factors into additive terms, while ln(y2) − ln(y1) = ln(y2/y1) expresses proportional change.
Fit and diagnose the model on its chosen scale, then transform outputs back appropriately. A monotone inverse transformation maps quantiles and interval endpoints directly, but the inverse of a mean is generally not the mean after transformation. For an exactly normal log-scale forecast, the original-scale distribution is lognormal and its mean includes a variance adjustment.

Three practical examples

  • A demand analyst models positive sales volumes whose typical fluctuations grow roughly with their level, then evaluates the forecasts in business units.
  • A researcher displays values spanning several orders of magnitude on a log scale to compare proportional differences.
  • A forecasting team uses differences of logged values to describe growth, distinguishing exact log changes from approximate percentage changes.

Think of it this way

Think of a measuring scale whose marks become farther apart multiplicatively: 1, 10, 100, and 1,000 are equally spaced on a base-ten log axis. The scale emphasizes ratios rather than equal absolute increments. A small distance on that axis can still represent a large absolute difference when the original values are large.

Worked example

Consider an original pair of positive values, 100 and 121. Their natural-log difference is ln(121) − ln(100) = ln(1.21), approximately 0.190620. Multiplying by 100 gives about 19.062 log-percent units, while the exact ordinary percentage increase is 21%. The approximation becomes closer for smaller changes.
The average of their logarithms, transformed back, is exp([ln(100) + ln(121)]/2) = 110, the geometric mean. Their arithmetic mean is 110.5. This demonstrates directly that transforming an average and averaging transformed values are different operations.
Now stipulate a continuous positive future quantity whose logarithm has a normal forecast distribution with mean ln(200) and standard deviation 0.3. Its original-scale median is 200. Its mean is 200 × exp(0.3 squared/2), approximately 209.2056. An approximate central 95% interval is [200 exp(−1.96 × 0.3), 200 exp(1.96 × 0.3)], or [111.0874, 360.0768]. The interval is asymmetric around 200 on the original scale.
These are exact lognormal mean and median relationships under the stipulated distribution, with a rounded normal quantile for the interval. They are not universal corrections for every model fitted to logged observations.

Illustrative case study

Illustrative fictional case: Acacia Orders fits a model to log-transformed positive order values. Its dashboard initially labels the exponentiated log forecast as expected revenue, even though the model output corresponds to a median under its assumed distribution.
The analyst separates median and mean forecasts, checks the distributional assumptions, and evaluates aggregate predictions on the original scale. The team also handles zero-order periods explicitly instead of silently dropping them. This fictional case illustrates how back-transformation affects business interpretation.

Common misconceptions and mistakes

The ordinary real logarithm is undefined for zero and negative values. Adding a constant, such as using log(1 + y), changes the transformation and interpretation; it is not a universal fix that preserves ordinary percentage relationships.
Do not assume that a straight line on a log plot proves a permanent growth law. Nor does a reduced visual spread prove constant conditional variance. A transformation can alter the relative importance of errors: fitting squared errors on the log scale does not optimize the same criterion as squared errors in original units. Exponentiating a log-scale mean without considering uncertainty can also mislabel a median as an original-scale mean.

Business use

Logarithmic transformations can make proportional business patterns easier to model and communicate, particularly for positive quantities with wide ranges. Their value should be established by diagnostics and forecasting performance, not by habit.
Document the base, any offset, zero-handling policy, and back-transformation method. State whether forecasts represent means, medians, or quantiles. When forecasts are aggregated across products or periods, ensure that the selected summaries are suitable for the aggregation and that uncertainty assumptions remain clear.

People also ask

Does changing the logarithm base change the ordering of positive observations?

No, for bases greater than one; it changes the numerical scale.

Is a log difference exactly a percentage change?

No. The exact proportional change from a natural-log difference d is exp(d) − 1.

Does the lognormal adjustment always apply?

No. It depends on the conditional log-scale distribution and the uncertainty included in it.

Check your understanding

What is the exact percentage increase from 100 to 121?

Answer: Twenty-one percent.

Why is the geometric mean 110?

Answer: It is the square root of 100 × 121, equivalently the exponentiated average natural logarithm.

In the stipulated forecast, which is larger: mean or median?

Answer: The mean, because the lognormal distribution is right-skewed.

Can zero be logged directly?

Answer: Not as an ordinary finite real logarithm.

Related terms

  • Logarithm
  • Prediction interval
  • log difference
  • percentage change
  • geometric mean
  • lognormal distribution
  • Box-Cox transformation
  • variance stabilization
  • back-transformation

Learn next

compare a model on the original scale with one on the log scale using the same forecast origins. Evaluate both in the units relevant to the decision, and inspect whether the required point forecast is a mean or another quantile.

More in Time series and signal processing

  • Linear interpolation smoothing - Linear interpolation smoothing combines two or more probability distributions using nonnegative weights that sum to one.
  • Ljung-Box test - The Ljung-Box test is a statistical test that jointly assesses whether a set of autocorrelations, from lag one through a chosen maximum lag, is consistent...
  • Loess - Loess is a local regression method that estimates a smooth relationship by fitting low-degree polynomials to nearby observations.
  • Lomb-Scargle Periodograms - Lomb-Scargle periodograms assess periodic structure by fitting sinusoidal models across a range of frequencies, including when observations are unevenly...
  • Metalevel state space - A metalevel state space is a representation of the possible internal computational states of an agent or program.
  • Multicollinearity - Multicollinearity is a strong linear relationship among two or more predictor variables in a model.

Sources

Sources: Hyndman and Athanasopoulos, Forecasting: Principles and Practice, transformations and bias adjustments: https://otexts.com/fpp3/toolbox.html . Glossary of Forecasting Terms, Logarithmic transformation: https://robjhyndman.com/mwh3/FG4.pdf . Primary textbook and glossary consulted. The ratio, geometric-mean, and stipulated lognormal calculations were independently checked; the case is fictional.

Previous: Logarithm Next: Logic

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer