Checking prediction agreement separately from correlation
A correlation of exactly 1 says two lists rise together in a straight line. It does not say the predictions equal the actual values. This guide uses predictions that are all one unit too high.
Perfect correlation with every prediction wrong
Let the actual values be 1, 2, 3 and the predictions be 2, 3, 4. Each prediction is higher than its actual value by 1, so no prediction is right. Yet the Pearson correlation between the two lists is 1. Correlation looks at how the lists move relative to their own averages, and here both rise by 1 at each step. The page runs the Pearson correlation calculator on x = 1, 2, 3 and y = 2, 3, 4 and gets r = 1. The same lists in the R squared calculator, as actual and predicted values, give -0.5. One data set produces the best possible correlation and a negative prediction score, and the two numbers are not in conflict, because they measure different things.
What Pearson correlation measures
The coefficient is r = Sxy / sqrt(Sxx × Syy), where each S is a sum over deviations from the list's own mean. Subtracting the means removes any constant offset, and dividing by the spreads removes any positive scale. The result depends only on the shape of the linear relationship, and it ranges from -1 to 1. A shift of one list by +1 changes none of the deviations, so r stays at 1. Multiplying a list by a positive constant changes the numerator and denominator in the same proportion, so r stays at 1 again. Correlation is therefore blind to both bias and scale. That is useful when you only care about association, and it is a trap when you care about matching values.
What prediction R squared measures
The score on this page is R² = 1 - sum((actual - predicted)²) / sum((actual - mean of actual)²). The numerator is the total squared miss of the predictions. The denominator is the squared miss you would get by predicting the mean of the actual values every time. A score of 1 means no misses, 0 means the predictions are no better than that constant guess, and a negative score means they are worse. For actual 1, 2, 3 and predictions 2, 3, 4, the squared misses are 1, 1 and 1, which add up to 3. The actual values have mean 2, so the baseline total is 1 + 0 + 1 = 2. The score is 1 - 3/2 = -0.5.
Why the score can be negative
Many people first meet R squared as the square of a correlation, which cannot be below zero, and then are surprised by a negative value. The two definitions agree only for a least-squares line fitted to the same data with an intercept. When predictions come from somewhere else, such as an earlier model, a forecast or another person, nothing keeps them close to the data, and the score has no lower bound. Predictions that sit 1 unit away from actual values with only 2 units of total variation in the actual data are worse than the mean, and the score says so. In this example the correlation squared is 1, and the prediction score is -0.5.
Scale errors hide in the same way
An offset is one way to be wrong while correlated. A scale error is another. Keep the actual values 1, 2, 3 and use predictions 2, 4, 6. The correlation with the actual values is again exactly 1, because doubling preserves the shape. The squared misses are 1, 4 and 9, which add up to 14, and the score is 1 - 14/2 = -6. A forecast that doubles every value is very poor, and correlation gives it full marks. Units are a common source: a model trained on kilometers and compared against miles, or one that predicts in cents when the targets are in dollars, will show strong correlation and a large negative R squared.
The good case and the mean case
For contrast, predictions that match the actual values, 1, 2, 3, give a correlation of 1 and an R squared of 1, with no misses. Predictions that always equal the mean, 2, 2, 2, have no spread, so correlation is undefined because the denominator would be zero, while R squared is 1 - 2/2 = 0. These cases fix the scale of the prediction score: 1 for perfect, 0 for the constant mean and anything below 0 for worse than the constant mean. Our example, at -0.5, falls below the mean-only baseline, even though its correlation is flawless. Checking that mean-only baseline is a quick sanity test for any forecast you are given.
Negative correlation and the sign
Correlation also carries a sign, and the sign has no counterpart in the prediction score. Predictions of 4, 3, 2 against actual values of 1, 2, 3 have a correlation of -1, because the lists move in exactly opposite directions, yet the squared misses are 9, 1 and 1, and the R squared is 1 - 11/2 = -4.5. A model that gets the direction backward and a model that is merely offset can both show a perfect correlation magnitude, but they fail in different ways. The sign of r is therefore worth reading first, and a strong negative r from a model meant to predict the same quantity usually points to a sign convention or labeling error upstream, such as predicted and actual columns being swapped or a flipped axis.
Which metric to report
Choose the metric from the question. If the goal is to know whether two quantities move together, such as height and weight or temperature and electricity demand, correlation is appropriate. If the goal is to judge a forecast or a model's output as a replacement for the real values, use error measures that compare values directly: mean absolute error, root-mean-square error or the prediction R squared, and report the units. For a calibrated model, a plot of predicted against actual values with the 45-degree line drawn makes bias and scale problems visible at a glance, which no single correlation number can do.
What this example shows
It shows one pair of lists for which the Pearson correlation is 1 and the prediction R squared is -0.5. It does not provide a threshold for a good score, and it does not say that correlation is a poor metric. It says only that the two have different meanings and that a correlation coefficient must not be labeled as prediction R squared. State the definition used when you report a score, and keep the prediction offsets available for inspection.
Reproduce the checks
Linear co-movement
Open the Pearson Correlation Calculator and enter:
- X observations
1,2,3- Y observations
2,3,4
Expected output:
R
1A common offset leaves perfect linear correlation.
Prediction agreement score
Open the R Squared Calculator and enter:
- Actual
1,2,3- Predicted
2,3,4
Expected output:
R squared
-0.5The nonzero prediction error is retained.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.
Sources
- Primary definition and convention reference ↗ · 2026-10-08
- Primary definition and convention reference ↗ · 2026-10-08