Calculator
Example data table
You can paste this same structure into the input box.
| Actual | Predicted |
|---|---|
| 100 | 98 |
| 120 | 121 |
| 140 | 137 |
| 160 | 165 |
| 180 | 176 |
Formula used
Let eᵢ = yᵢ − ŷᵢ, ȳ = mean(y), n = observations, k = predictors, p = k + intercept SSE (RSS) = Σ eᵢ² SST = Σ (yᵢ − ȳ)² R² = 1 − SSE / SST Adj R² = 1 − (1 − R²) · (n − 1) / (n − p) MSE = SSE / n RMSE = √(MSE) RSE = √(SSE / (n − p)) AIC = n · ln(SSE / n) + 2p (Gaussian residuals) BIC = n · ln(SSE / n) + p · ln(n) F = ((SST − SSE)/k) / (SSE/(n − p)) DW = Σ(eᵢ − eᵢ₋₁)² / Σ eᵢ²
If SST is zero, R² is undefined. If n ≤ p, adjusted measures are not defined.
How to use
- Choose an input mode: paste pairs or use summary statistics.
- Enter predictors (k) and keep intercept enabled for most models.
- Paste two columns: actual first, predicted second, one row per line.
- Click Calculate to display indices directly under the header.
- Download CSV for reporting or PDF for sharing.
What Fit Indices Capture
Fit indices summarize how closely predictions track observed outcomes. The calculator derives variance explained, absolute error, and scale-free ratios. For example, SSE aggregates squared residuals, while SST measures total variation around the mean. When SSE is small relative to SST, R² rises and the model explains more signal than noise. Use multiple indices because one number rarely describes stability, bias, and usefulness together.
Interpreting R² and Adjusted R²
R² reports the proportion of variance explained, but it can increase whenever you add predictors. Adjusted R² compensates by accounting for parameters p, so it only improves when added features reduce error enough to justify complexity. With n=120 and k=6, a rise from 0.78 to 0.79 may be meaningful, yet a drop in adjusted R² warns of overfitting. Compare both values across candidate models.
Error Metrics That Match Business Units
RMSE is measured in the same units as the target, making it easy to communicate impact. If RMSE is 8.2 on a sales target near 160, typical misses are about eight units. MAE is less sensitive to outliers, while MAPE expresses relative error when actual values are nonzero. CVRMSE converts RMSE into a percent of mean(y), helping compare sites or cohorts with different scales.
Using AIC and BIC for Model Choice
AIC and BIC balance fit against complexity using a likelihood-style penalty. Lower scores indicate a preferable trade-off under the same dataset and response. A difference of 2 to 4 suggests weak evidence, while 6 or more is strong. Because BIC penalizes parameters more heavily, it often favors simpler models when n is large. Use these metrics to select between similar R² values.
Residual Diagnostics for Trustworthy Forecasts
Durbin–Watson tests whether residuals are serially correlated in the row order. Values near 2 indicate little autocorrelation, below 1 suggests positive correlation, and above 3 suggests negative correlation. Theil’s U compares forecast performance against scale, where smaller values indicate better similarity. Review diagnostics, then examine data splits and feature leakage. Track changes after tuning, and document assumptions for audits and stakeholders, future reviews. Always validate with fresh data before deployment.
FAQs
Which input mode should I use?
Use pairs when you have actual and predicted values. Use summary mode when you only know SSE and SST from a report. Pair mode unlocks MAE, MAPE, Durbin–Watson, Theil’s U, and a cleaned preview.
How do I choose k and intercept?
Set k to the number of predictors in your regression. Keep intercept enabled for most linear models. If your model is forced through the origin, disable the intercept so parameter counts and adjusted metrics reflect that choice.
Why is R² shown as N/A sometimes?
R² needs SST greater than zero. If all actual values are identical, SST becomes zero and explained variance cannot be computed. In that case, rely on error metrics like RMSE and MAE to judge performance.
What thresholds indicate a good fit?
It depends on the domain and noise. Compare models on the same dataset. Look for higher adjusted R², lower RMSE and MAE, and meaningfully lower AIC or BIC. Validate the chosen model on a holdout set.
What does Durbin–Watson tell me?
Durbin–Watson checks residual autocorrelation in the row order. Around 2 suggests independence, below 2 indicates positive autocorrelation, and above 2 indicates negative autocorrelation. For time series, reorder rows by time before computing.
How are the PDF and CSV exports built?
CSV exports the metric table shown in Results. PDF generates a printable report from those same metrics in your browser. If your environment blocks downloads, use the print dialog or allow popups and file downloads.