# range of coefficient of determination R^2 (can be negative?)

According to wikipedia, the coefficient of determination is

$$R^2 = 1 - \sum_i{\frac{(y_i - f_i)^2}{(y_i - \bar{y})^2}}$$

where $y_i$ is the $i^{th}$ sample value, $f_i$ is the model predicted value and $\bar{y}$ is the mean value.

I can imagine a simple case with two sample points where the coefficient of determination will be negative. Basically, the problem comes when the regression line is really bad, predicting the regression line as negative of the correlation. But in the places I've read about it, they say that it's range is [0,1]. Can anyone explain? • Note that the wikipedia page doesn't actually say that $R^2$ is always in [0, 1], just that it's in it in a particular type of case. In the "interpretation" section, it clearly says that values <0 and >1 are possible. – naught101 Apr 21 '13 at 13:23
• Removed irrelevant tag for coefficient of variation and added R-squared tag. – Nick Cox Jan 8 '18 at 12:19

## 2 Answers

"they say that it's range is [0,1]" and they are wrong as it can indeed be negative although to be significantly negative the model has to be intentionally bad and the max is indeed 1.0.

Negative values of $R^2$ may occur when fitting non-linear functions to data.

In cases where negative values arise, the mean of the data provides a better fit to the outcomes than do the fitted function values, according to this particular criterion.