Suppose that there is a dataset of 2D points $(x_i, y_i)$, consider the following statement:

"When the Pearson Correlation Coefficient(PCC) between $x$ and $y$ is equal to -1 or 1 (highest absolute values), data could be described by a straight line". That is, there are constants $a$ and $b$ such that:

$y_i = ax_i+b \;\;\: \forall i$

Now, I have two questions:

1) Is the above statement true?

2) More importantly, if the statement is true, please give a mathematical proof.

I have visually seen that a line can be fitted perfectly on such a dataset, but I am not sure this is always true, so I need a mathematical proof.

  • 2
    $\begingroup$ To answer 1): yes, a value of 1 implies that a linear equation describes the relationship between X and Y perfectly, with all data points lying on a line. $\endgroup$ Sep 5, 2019 at 10:00
  • 1
    $\begingroup$ Part of the Cauchy-Schwarz Inequality asserts "Moreover, the two sides are equal if and only if $\mathbf {u}$ and $\mathbf {v}$ are linearly dependent," QED. $\endgroup$
    – whuber
    Sep 5, 2019 at 15:02
  • $\begingroup$ Just to be clear. Nothing guarantees that a newly chosen point will fall on the line. The function may only be linear in the region where the points were taken. It is also possible that a new point taken between two data points could fall off the line. Now if you have a strange error term distribution that has a probability less than 1 of being 0 & consequently a positive probability of being different from 0 a new point could fall off the line and the linear equation previously determined could still hold. $\endgroup$ Sep 14, 2019 at 22:25

1 Answer 1


For the answer 1), I just invite you to read the comment by @user2974951 which in a couple of words says exactly what is worth. I cite it "a value of 1 implies that a linear equation describes the relationship between X and Y perfectly, with all data points lying on a line". I stress the importance of linear, as the correlation is a measure for the linear interaction between variables.

Now for the point 2), I apologize if I only sketch a proof due to serious time constraints and very busy days on my side. But it will be enough. Consider that in a univariate regression with a single independent variable like $y_{i}=a+\beta x_{i}+ \epsilon_{i}$ with $i=1,...,n$, the $R^{2}$ of the regression can be retrieved as the square of the correlation coefficient between the two variable. Therefore setting the corr equal to 1 implies $R^{2}=1$. Take the formula for $R^{2}$ (here we take the one assuming there is an intercept as you hinted) given by:


Then set it to 1 and solve for the sum of squared errors at the numerator, then evaluate the implications for each observation residual. You get:

$$R^2=1 \rightarrow 1-\frac{\sum_{i=1}^{n}e_i^2}{\sum_{i=1}^{n}(y_i-\bar{y})^2} = 1 \rightarrow \frac{\sum_{i=1}^{n}e_i^2}{\sum_{i=1}^{n}(y_i-\bar{y})^2} = 0 \rightarrow \sum_{i=1}^{n}e_i^{2} = 0 \rightarrow e_i^{2}=0 \text{ for each i} \rightarrow e_i=0 \text{ for each i} \rightarrow y_{i}=a+\beta x_{i} \text{ for each i}$$

  • $\begingroup$ For a much shorter demonstration, please see my comment to the question. $\endgroup$
    – whuber
    Sep 5, 2019 at 15:02
  • $\begingroup$ @whuber very nice! Thanks $\endgroup$
    – Fr1
    Sep 5, 2019 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.