AI Glossary / Statistics and probability / Beginner
Linear transformation
Definition
In the supplied statistics glossary, a linear transformation changes a numerical variable by multiplying it by a constant and adding a constant: Y = a + bX. It shifts the origin, changes the scale, or both. Strict linear algebra calls this an affine transformation when a is nonzero; a strictly linear map must preserve zero. This entry follows the glossary's statistical rescaling sense while making that terminology distinction explicit.
What it means
The constant a moves every value by the same amount. The constant b changes differences between values by a common factor. For positive b, ordering is preserved; for negative b, ordering reverses. If b is zero, every value becomes a and the original variation is lost.
Examples include converting temperature units, centering a feature, and expressing an amount in different units. A logarithm, square root, or reciprocal of the variable is not a linear transformation in this sense because its effect on gaps changes across the scale.
How it works
Apply the same constants consistently to every relevant observation. With finite moments, E(Y) = a + bE(X), Var(Y) = b squared Var(X), and SD(Y) = absolute value of b times SD(X). Equivalent relations hold for sample means, variances, and standard deviations when calculated consistently.
Adding a constant changes location without changing spread. Multiplying by a negative number reverses direction but cannot make a variance or standard deviation negative. For b nonzero, the transformation is reversible: X = (Y - a)/b.
When constants are learned from training data, save them and reuse them on validation and deployment data. Re-estimating them from future observations can introduce leakage or inconsistent feature definitions.
Three practical examples
- A team converts sensor temperatures from Celsius to Fahrenheit using F = 32 + 1.8C, retaining equivalent physical measurements on a different scale.
- An analyst centers a numerical predictor by subtracting its training mean so that zero represents a typical training value.
- An AI pipeline scales monetary amounts from currency units to thousands of units, keeping labels and inverse transformations available for business reports.
Think of it this way
Think of replacing a ruler with one whose zero mark and tick spacing differ. The measured objects have not changed. Their numerical descriptions have changed in a predictable way. If the ruler's numbering runs backward, the ordering of numbers reverses, but the underlying objects remain the same. That is why units and direction must accompany transformed results.
Worked example
Take three fictional temperature readings: 10, 20, and 30 degrees Celsius. Their mean is 20. Using the sample denominator n - 1 = 2, their variance is [(10 - 20) squared + 0 + (30 - 20) squared]/2 = 100, and their standard deviation is 10.
Apply F = 32 + 1.8C. The readings become 50, 68, and 86 degrees Fahrenheit. Their mean is 68, which equals 32 + 1.8 x 20. Their sample variance is 1.8 squared x 100 = 324, and their sample standard deviation is 18.
The added 32 affects the mean but not the spread. As a separate rescaling example, Y = 100 - 2C produces 80, 60, and 40. Its mean is 60 and its standard deviation is 20, not -20. Its sample variance is 400.
Both transformations are invertible because their multipliers are nonzero. Neither creates new observations or improves the underlying measurement accuracy; both only change representation.
Illustrative case study
Fictional case: Brightmill Analytics trains a prediction model using energy readings centered and scaled with the training dataset's mean and standard deviation. A deployment engineer initially recomputes those constants every morning from the latest batch.
The team notices that identical raw readings can then receive different transformed values on different days. It revises the pipeline to use the saved training constants and monitors distribution changes separately.
Reports convert predicted quantities back into operational units. The company treats any decision to update the scaling constants as part of a controlled model update, rather than silently changing the meaning of inputs while keeping old coefficients.
Common misconceptions and mistakes
Do not multiply standard deviation by a negative scale factor without taking its absolute value. Do not add the shift constant to variance. And do not assume rescaling removes skewness or makes an arbitrary distribution normal: a nonzero affine rescaling preserves its basic shape, with possible reflection.
A translation is not a strictly linear map in linear algebra, even though introductory statistics often uses the broader term. Standardization also needs nonzero spread; dividing by a zero standard deviation is undefined. Finally, changing units can alter coefficients without changing equivalent predictions.
Business use
Linear transformations help integrate data sources, improve numerical scaling, and make features easier to interpret. They also support clear reporting across teams using different units.
Record transformation constants, units, source population, and version. Ensure validation data use the intended training transformation. Test a few forward-and-inverse examples to catch sign, offset, and unit mistakes. Rescaling may affect regularized or distance-based methods unless their settings are adjusted appropriately; equivalent raw information does not guarantee identical behavior from every algorithm.
People also ask
Does adding ten increase standard deviation?
No. All deviations from the mean stay the same.
Does multiplying by three multiply variance by three?
No. It multiplies variance by nine and standard deviation by three.
Does rescaling change Pearson correlation?
For nonzero scales and nonconstant variables, its magnitude is preserved; reversing the direction of one variable reverses the sign.
Check your understanding
A variable with mean 20 and standard deviation 10 is transformed to Y = 100 - 2X. What are the new mean and standard deviation?
Answer: The mean is 100 - 2 x 20 = 60. The standard deviation is absolute value of -2 times 10 = 20. Spread remains nonnegative even though the transformation reverses ordering.
Related terms
- Affine transformation
- Centering
- Scaling
- Standardization
- Variance
- Covariance
- Data leakage
- units of measurement
Learn next
Next, compare affine rescaling with nonlinear transformations such as logarithms. Then examine how preprocessing interacts with regularization, distance calculations, coefficient interpretation, and recovery of predictions in original units.
More in Statistics and probability
- Linear prediction - Linear prediction estimates an unknown quantity using a weighted sum of available observations or features, often with an intercept.
- Linear regression - Linear regression models a numerical outcome using a sum of explanatory features multiplied by coefficients, usually with an intercept.
- Linear relationship - A linear relationship is one whose systematic pattern can be represented by a straight line on the stated measurement scales.
- Linear trend estimation - Linear trend estimation fits a straight-line change over time to observed data, commonly using a model such as Yt = a + bt + error.
- Linearity of regression - Linearity of regression is the assumption that the systematic mean relationship is adequately represented by the specified linear form.
- Linkage disequilibrium score regression - Linkage disequilibrium score regression, usually abbreviated LD Score regression or LDSC, is a method that relates genome-wide association statistics to...
Sources
Sources: Howell, Statistical Methods for Psychology glossary, Linear Transformation: https://www.uvm.edu/~statdhtx/methods8/Glossary/Glossary.html . Geyer, Principal Components Theory Notes, scalar and vector transformation formulas: https://www.stat.umn.edu/geyer/f06/5601/theo/spect/spect.pdf . Wolfram, AffineTransform, for the mathematical terminology: https://reference.wolfram.com/language/ref/AffineTransform.html . These primary references were consulted. The numerical dataset and fictional case are original; transformed moments were independently calculated.
Previous: Linear temporal logic Next: Linear trend estimation