Skip to main content

Questions tagged [negative-r-squared]

For questions about when and why an r-squared-style calculation yields a value below zero.

Filter by
Sorted by
Tagged with
3 votes
1 answer

Out-of-sample R square is NEGATIVE [closed]

The "Out-of-sample $R^2$" is defined as: $$ R^2_{OOS} = 1 - \frac{\sum_{t=\tau}^T\left(Y_t - \hat{Y}_{t\vert t-1}\right)^2}{\sum_{t=\tau}^T\left(Y_t - \hat{\mu}_{t\vert t-1}\right)^2} $$ ...
Alya's user avatar
  • 31
3 votes
1 answer

Definition of $\text{“}R^2\text{”}$

I have always taken $\text{“}R^2\text{”}$ to mean the proportion of a sum of squares explained by a model. The context in which this idea is first encountered is when one explains part of the total ...
Michael Hardy's user avatar
0 votes
0 answers

negative $R^2$ but positive correlation [duplicate]

I have a predictor $\hat{y}$. I have noticed that the correlation between $\hat{y}$ and $y$ are quite positive, above 50% even, while the $R^2$ is negative. Note that this is an out-of-sample $R^2$ ...
Taylor Fang's user avatar
0 votes
0 answers

Low CV-RMSE and negative $R^2$ (comparative)

I am trying to predict a numeric variable using XGBoost with optuna for hyperparameter optimization. I defined two objective functions for optuna, one optimized for very small datasets (5 to 17 ...
RaduIoan's user avatar
10 votes
2 answers

Negative R2 on Simple Linear Regression (with intercept)

I am doing a simple Linear Regression (with intercept) which ends up presenting a negative R2, this should not be possible (cf comment 2 at the end) Reproducible examples of the issue: Minimal ...
Jean Lescut's user avatar
3 votes
1 answer

Gam using mgcv is giving negative deviance explained

I run a null binomial generalized additive models (gam) using mgcv and it gives negative deviance explained! As far as I know deviance explained is analogue of R^2 ...
user avatar
2 votes
0 answers

Test regression coefficient when overall regression has $R^2_{adj}<0?$

I have recently read some work that features hypothesis testing of individual regression coefficients when the overall regressions featuring those coefficients have $R^2_{adj}<0$. One example is ...
Dave's user avatar
  • 64.4k
1 vote
1 answer

Is the multiple correlation coefficient $(R)$ undefined in the case of negative determination coefficients $(R^2)$ - Neural network models?

I noticed that in some low performance models of neural networks, the value of $R^2$ (coefficient of determination) can be negative. That is, the model is so bad that the mean of the data is better ...
Leonardo's user avatar
6 votes
2 answers

Are consistently negative Efron's pseudo-r2 in logistic regression possible?

I am conducting logistic regression and looking to calculate pseudo-R2 values alongside AIC and BIC for model evaluation. I selected Efron's pseudo-R2 because of its simple calculation and the ...
stat_is_quo's user avatar
6 votes
1 answer

Simple linear regression: R2 not equal to squared Pearson coefficient

The R2 of a simple linear regression model is the squared Pearson correlation coefficient (r) between the observations and the fitted values. Isn't the above in contradiction with the fact that the ...
Antoine's user avatar
  • 6,187
1 vote
1 answer

How to check model's accuracy and predict which model is effective enough from mean_absolute_error , mean_squared_error and R-square error?

I am trying to predict future forecasting of COVID-19 data using Polynomial Regression model and SVM model. The plot of Test Data versus Polynomial Regression Predictions come as: MAE: 2073239....
Soumya Shree's user avatar
8 votes
3 answers

Why can $R^2$ be negative in linear regression -- interview question [duplicate]

I was asked an $R^2$ question during an interview, and I felt like I was right then, and still feel like I'm right now. Essentially the interviewer asked me if it is possible for $R^2$ to be negative ...
24n8's user avatar
  • 1,147
1 vote
0 answers

Coefficient of determination different in sklearn and GLM

I have a linear regression problem and I am fitting a model in statsmodels and the same model in sklearn with Ridge Regression. I get almost the same estimates for the coefficients, but the ...
Len's user avatar
  • 33
1 vote
2 answers

Slope uncertainty of linear regression with negative $R^2$ value

When I have a linear regression and I want to determine uncertainty in the slope from the quality of the fit (ignoring any uncertainty from error bars for now), I generally use $$ \sigma_m = m \sqrt{\...
Bunji's user avatar
  • 145
48 votes
6 answers

What does negative R-squared mean?

Let's say I have some data, and then I fit the data with a model (a non-linear regression). Then I calculate the R-squared ($R^2$). When R-squared is negative, what does that mean? Does that mean my ...
RockTheStar's user avatar
1 vote
2 answers

What is R squared for a neural network and what does it signify?

I calculated R square for my neural network based on a formula I found somewhere, which goes something like: $$ R^2=1-\left(\dfrac{ \overset{N}{\underset{j=1}{\sum}}\left( t_j-o_j \right)^2 }{ \...
user53030's user avatar
4 votes
3 answers

Negative R squared contradicts ssa/sst?

I understand from this question - When is R squared negative? that the R squared value of a linear regression model can be negative if the intercept is constrained. And this makes sense if you ...
ryu576's user avatar
  • 2,540