You have a pipeline that records the temperature at 2 different locations. Each entry in the pipeline consists of a pair of values corresponding to the two locations. To further reduce space, the pipeline deletes these entries and stores their count, means and covariance matrix. Your colleague would like to represent each pair of values with a single value. In which direction should this single value representation be encoded?
To answer the question, let’s perform a standard principal component analysis. First draw a line through the center of the values to be analyzed and project each pair to this line. The value encoded is the signed distance along the line from the center to the projected value. The further values are from the line, the more information is lost. Standard PCA states that the line drawn by the analysis should be such that the average value of the squared distance of values from the line is minimized.
Suppose your colleague has concluded that each pair of values may move in the plane by up to 0.25 of a degree in Euclidean distance. They are interested in which line should be encoded to represent the pair to give the smallest worst-case squared error in reconstruction of the values. Now the covariance of the pair of values is not sufficient to determine this. Two different batches of paired values may have the same covariance yet favor different lines.
On the 18th of November 2026, Zhouxing Luo, Xin Liu, and Lei Wang posted a paper on arXiv in which they derive an exact score for principal component analysis under a displacement bound to resolve some of these ambiguities. Example 2 of the authors shows two datasets with the same covariance giving different scores for a line held fixed. Another example could be a pipeline. In such a case could removing the data rows hide the preferred line? Two examples that follow are artificial. Using the authors’ definition and expression 3² + 4² = 5², the score of each line for each of these examples can be calculated correctly.
Change four rows and keep the covariance
Think of the two readings as differences in degrees Celsius from the respective means. The horizontal coordinate comes from the first sensor and the vertical coordinate comes from the second sensor. Take two sets of data points named A and B. They have six data points in common. In each set add one data point each at (0, 4) and (0, -4) and two data points each at (0, 2) and (0, -2).
In each set there are ten data points overall. The remaining four data points of each set are located on the horizontal axis with x-values of -5, 0, 0 and 5 in A, and -4, -3, 3 and 4 in B. The sum of the squared x-coordinates of each set is 50. The contribution of the vertical coordinates is 48. The averages of the squared coordinates of the ten observations of each set with respect to the horizontal and vertical coordinates are 5 and 4.8, respectively. There is no covariance between the two sensors.
[ 5.0 0.0 ][ 0.0 4.8 ]
To compute the squared reconstruction error of a data point with respect to a horizontally drawn line, that data point’s vertical coordinate would need to be squared. The average cost is 4.8. Keeping the vertical line would increase the cost to 5.0. The matrix expresses the same idea differently. The larger eigenvalue is 5.0 associated with the x direction where larger changes occur in the data. In standard principal component analysis the horizontal line would be retained. The sample covariance matrix would use a divisor of 9 instead of 10, giving the same principal direction.
Consider the four x values in the data set. The sums of the absolute values of these numbers are 10 in case A and 14 in case B, respectively. This difference becomes apparent to the fit of the model once the data values are allowed to move from their current positions.
What can a quarter-unit error do?
Initially, place a line on the page and give a displacement budget of ρ to reading a distance d from the line, measured in a direction perpendicular to the line. From that position maximizing the reconstruction error of the reading would require moving it directly away from the line by ρ, to a distance of d + ρ. A reading which is initially assigned a position on the line can move in either perpendicular direction.
This situation is referred to as an ‘infinity-Wasserstein’ uncertainty set by the authors of the paper. Think of each of these points as mass. You may move the mass representing the point any distance up to ρ in any direction with respect to the point. Additionally, the mass may be divided and distributed between different points within the ρ radius from the point. Prior to performing the analysis, these mass points were located at their recorded coordinates. At ρ = 0.25, moves of 0.25 in x or y would use up the entire allowance.
There is one last step to take before using d + ρ. In the case of PCA, moving the points can move the mean to which the line is fit. The authors of the paper describe how to correct for this. In the case of each direction of a new line, shift the line sideways to minimize the mean of (dᵢ + ρ)², where dᵢ is the distance of the point to the new line. In each of our batches of points, there are pairs of points located directly across from each other. Moving the line by the same amount in one direction would give the same score as in the other. A line through the origin would therefore minimize the score, which is convex in the offset.
Prior to any calculations, the score should be determined using the formula described in the paper. In this example the score would be the mean of the squared distances of the points to the line, plus 2ρ times the mean distance of the points to the line, plus ρ². Ordinary PCA already accounts for the first term of this score. The last term is the same for all lines to be fitted. The mean of the original distances would determine the cost of moving the points to increase the score. Therefore, of the two batches of points with the same mean squared distance, the one with the greater mean distance would be more negatively impacted by moving each point a quarter of a unit directly away from the line.
Find the radius where the decision changes
Table 1. Distances from the original readings to each retained line. Keeping x means keeping the horizontal line. Keeping y means keeping the vertical line. Mean squared distance (°C²) is the same in both batches. Mean distance is in °C.
Take A first. Compared to a horizontal line, the mean squared error of a vertical line would be greater by 0.2. Once the displacement reaches 1/6, the benefit in the intermediate term is 2ρ × 0.6, which exactly cancels out the 0.2 disadvantage. Increasing ρ beyond 1/6 causes the vertical line to win.
Batch B also starts with a 0.2 disadvantage. In this case, the vertical line has to have a radius of 1/2 to break even. For values of ρ between 1/6 and 1/2, the vertical line would be more appropriate to use for A and the horizontal line for B. A quarter of a unit lies in this range.
In Table 1 I have given a comparison of the two lines in question. Prior to choosing a sensor I would check if a diagonal line outperforms the other two lines. In the case of Example 1 given in the paper at ρ = 1, the horizontal and vertical line scores would be 3.625 and 4 respectively. Using the same calculation with the line x + y = – 1/2, we get about 3.602. There may be even better choices of line which would be better yet to use in the paper’s example.
For our 10-row case, we can simplify things and say that a concave function of t on [0,1] attains its minimum at an endpoint, where t = sin²θ and θ is the angle of the line to the horizontal. Thus the function giving the score of the retained line is concave in t (the mean squared distance is linear and the mean distance is a positive weighted sum of √t and √(1 − t)), and is most favorable when the line is completely horizontal or vertical. The endpoints are vertical and horizontal lines. Away from its own switch radius, the line that best fits the data in each case wins the choice.
Run the two fits
This Python example retains all rows including repeating rows in the data. Horizontal and vertical candidates determine residuals with respect to y and x respectively. Fractions allow an exact comparison of the lines at the switch radii.
from fractions import Fractioncommon_y = [(0, 4), (0, -4), (0, 2), (0, -2), (0, 2), (0, -2)]batches = {"A": common_y + [(-5, 0), (0, 0), (0, 0), (5, 0)],"B": common_y + [(-4, 0), (-3, 0), (3, 0), (4, 0)],}radius = Fraction(1, 4)def score(residuals, radius):return sum((abs(value) + radius)**2 for value in residuals) / len(residuals)for name, rows in batches.items():x, y = zip(*rows)horizontal = score(y, radius)vertical = score(x, radius)best = min(horizontal, vertical)fits = [line for line, value in (("horizontal", horizontal), ("vertical", vertical))if value == best]print(f"{name} horizontal={float(horizontal):.4f} "f"vertical={float(vertical):.4f} fit={' and '.join(fits)}")
A horizontal=5.6625 vertical=5.5625 fit=verticalB horizontal=5.6625 vertical=5.7625 fit=horizontal
What is the cost of taking that action for batch A? Using the 10 values in the sample, mean squared error of the vertical model would be 5.0 °C², as compared to 4.8 °C² of the horizontal model. With a quarter-degree constraint on displacement, worst-case mean squared error of the vertical model would be 5.5625 °C², as compared to 5.6625 °C² of the horizontal model. Given the scant information available, I would take the 0.2 increase in batch average squared error to retain the vertical model. This would depend on my level of confidence in the bound on the displacement.
Change the value in the code from 0.25 to 0 to favor the horizontal model of the two batches of data. Use 1/2 for a tie in batch B.
Which uncertainty are you willing to defend?
Let’s say there is a budget on the root mean square displacement of the sensor pairs, but in some cases the displacement may be much larger than average. The authors’ second model addresses this situation. In the case of isotropic order-2 Wasserstein uncertainty the expression for worst-case mean squared error would be (ρ + √MSE)², where MSE is ordinary mean squared error. In other words the ordinary mean squared error would determine the score and give the same preferred line as ordinary PCA.
The authors solve their larger data set problem by using an eigensolver to compute the principal subspace of the reweighted data at each iteration. To do this they compute the residuals for each data point with respect to the current model and update weights using these residuals. They then calculate the weighted mean of the data points to define the weighted center of the principal subspace. This illustrates a memory constraint of the algorithm. Prior weights of the data points depend on their distance to a line. Tomorrow’s weights may depend on their distance to a different line. The authors also give a theoretical result on convergence showing that every accumulation point is stationary. Our result on the global minimum is based on the geometrical relationship of the ten rows of each data matrix.
The authors also give a separate result on population reconstruction error using independent and identically distributed random variables with a finite fourth central moment. From this result they define a threshold radius. At or above this threshold, with high probability, the robust score would be at least the population reconstruction error with respect to every candidate subspace simultaneously. The threshold is determined by some of the population characteristics of the data including the magnitude of non-zero eigenvalues of the population’s covariance matrix. The ten constructed data rows indicate the direction in which the robust principal component of each batch lies at this radius. No calibration on any real world sensor has been performed to validate this claim.
What should the pipeline keep?
Based on the stored information alone, I cannot say which sensor to retain under the quarter-degree bound. Either batch of data could produce the summary statistics stored by the pipeline.
On the next batch, I’ll see what the calibration sheet means by “a quarter of a degree.” Using separate limits for each sensor would allow the thermocouples to read higher by 0.25 degrees. The pair of thermocouple readings could move diagonally by about 0.354 degrees, outside the assumed circle. With only a root mean square displacement bound, principal component analysis would suggest the same direction to retain for the pair as the isotropic order-2 model.
For these batches of data, I’d save any additional requested in Table 1. Should the next user of the data be able to select either the x or y axis, the average of the absolute values of each would also be useful. If no user restriction to a particular axis is implemented, I would also save the corresponding pairs of values. Users would then be able to determine the distance of each pair from the corresponding line.
In this particular case, 0² + 5² and 3² + 4² both summed to 25 before being stored, losing the difference between 0 + 5 and 3 + 4. At a quarter of a degree of allowable displacement this would determine which thermocouple to retain.
Reference
[1] Z. Luo, L. Wang and X. Liu, Infinity-Wasserstein Distributionally Robust Principal Component Analysis: Exact Reformulation, Finite-Sample Guarantee, and Efficient Algorithm (2026), arXiv:2611.23877v1.