At the start, please forgive me if my question is too elementary.

I am fitting a non-linear curve. Say a parabola. The data points I have are close to a parabola and the best output I get is a parabola. I want to quantify the quality if fit. Something like an R-Squared metric. I was wondering if the R-Squared metric, like in the case of a linear OLS, makes sense since one of the inputs for R-squared is the average of the input values, which I'm not sure makes sense for a parabola.

Can someone please help?


2 Answers 2


OLS quadratic model: $y = \beta_0 + \beta_1 X + \beta_2 X^2$

Your model is still a linear function of the unknown parameters $\beta$ with the features $X$ and $X^2$. Hence $R^2$ is still applicable.

  • $\begingroup$ The equation "y = B0 + B1 * sin(x) + B2 * log(x)" is linear in the coefficients and can be fit using linear algebra just as can be done with quadratic polynomials. Would you consider R-squared applicable in this case? Both this example equation and a quadratic polynomial can also be fit using non-linear regression, in both of those cases would R-squared be applicable? My understanding is yes for these questions. $\endgroup$ Commented May 25, 2019 at 15:52
  • $\begingroup$ So (non-)linearity is about the coefficients $ \beta_i $ and not about $ X $ ? $\endgroup$
    – Ben
    Commented Jul 31, 2020 at 9:18

I calculate R-squared (R2) as "R2 = 1.0 - (regression_error_variance / dependent_data_variance)" and use it to tell me the fraction of the dependent data variance that is explained by the regression model. For non-linear equations this is both approximate and useful. For example if the R-squared value from an exponential regression is 0.75, I interpret this as meaning that the fitted equation explains 75 percent of the dependent data variance. In the case of your parabola example, the model is not a straight line and so the R-squared value is also both approximate and useful. My understanding is that R-squared is only exact for straight lines.


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.