# Questions tagged [negative-r-squared]

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

17 questions
Filter by
Sorted by
Tagged with
70 views

### 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}$$ ...
• 31
83 views

### 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 ...
• 10.3k
72 views

### 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$ ...
• 215
61 views

### 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 ...
582 views

### 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 ...
• 346
161 views

### 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 ...
55 views

### 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 ...
• 64.4k
1 vote
126 views

### 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 ...
• 23
1k views

### 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 ...
• 137
6k views

### 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 ...
• 6,187
1 vote
269 views

### 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....
1k views

### 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 ...
• 1,147
1 vote
79 views

### 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 ...
• 33
1 vote