Configure the Residual Analysis
Formula Used
Residual: ei = yi − ŷi
Residual mean: ē = Σei / n
Sample spread: s = √[Σ(ei − ē)² / (n − 1)]
RMSE: √[Σei² / n]
Jarque–Bera: JB = n / 6 × [S² + K² / 4]
Here, S represents skewness. K represents excess kurtosis. Smaller residual spread usually indicates steadier prediction errors.
How to Use This Calculator
- Choose direct residuals or paired actual and predicted values.
- Paste at least three numeric observations into the matching fields.
- Select a separator, transformation, histogram rule, and density options.
- Choose an outlier method and its preferred detection threshold.
- Press the calculation button to display metrics and plots.
- Review skewness, tails, outliers, and the normal quantile alignment.
- Download the calculated residual table when further review is needed.
Understanding Residual Distribution Diagnostics
Residual Distribution Basics
Residuals are differences between observations and predictions. They reveal errors that average performance scores often conceal. Their distribution helps diagnose assumptions behind many regression methods.
A balanced residual distribution usually centers near zero without strong asymmetry. Large shifts can indicate persistent underprediction or overprediction. Such bias weakens forecasts and complicates business interpretation.
Reading Histograms and Density Curves
Histograms group residuals into intervals that show common error ranges. Narrow central bars suggest consistent predictions reliably. Wide tails reveal occasional errors that deserve closer inspection.
Kernel density curves provide a smoother view than histogram bars. Their shape depends on bandwidth choices. Comparing both views prevents conclusions based on one display.
Central Tendency and Spread
Mean residual measures systematic direction across the complete dataset. A value near zero is desirable but not sufficient. Positive and negative errors may cancel while problems remain.
Standard deviation describes typical dispersion around the residual mean. Smaller values usually indicate tighter predictions on similar scales. Scale comparisons require standardization or domain-specific reference values.
Skewness and Tail Weight
Skewness measures whether one tail extends farther than another. Positive skew reflects larger positive residuals appearing more often. Negative skew indicates stronger errors in the opposite direction.
Excess kurtosis describes tail weight against normality. High values suggest extreme errors occur more frequently than expected. Low values indicate flatter shapes with lighter tails.
Normality and Quantile Alignment
Normality matters for classical confidence intervals and significance tests. Perfect normality is rarely required for useful prediction. Serious departures still warn about unstable uncertainty estimates.
A quantile plot compares ordered residuals with theoretical normal quantiles. Straight alignment supports an approximately normal error structure. Curved ends often signal heavy tails or unusual observations.
Outliers and Robust Detection
Outlier rules identify residuals that differ strongly from typical behavior. IQR rules work well without assuming a normal distribution. Z-score rules are simpler when distribution assumptions remain reasonable.
MAD detection offers robust screening when extreme values distort standard deviation. Each flagged case should receive contextual review before removal. Automatic deletion can hide data quality or modeling problems.
Model Improvement Decisions
Residual patterns may result from omitted variables or nonlinear relationships. Heteroscedasticity appears when error spread changes across prediction levels. Grouped errors may expose missing interactions or segment effects.
This calculator summarizes distribution shape using several complementary diagnostics. Users can compare raw, centered, or standardized residual values. Flexible bins and density settings support different sample sizes.
Review flagged observations against source records and collection procedures. Retrain models after correcting confirmed issues or adding useful features. Reliable residual checks support safer predictions and clearer decisions.
Frequently Asked Questions
What is a residual distribution plot?
It shows how prediction errors are distributed around zero. The shape reveals spread, skewness, tails, and unusual errors. Balanced errors often support better regression assumptions.
Should residuals always follow a normal distribution?
No. Normality matters most for certain inferential procedures. Prediction tasks may remain useful without perfect normality. Strong deviations still deserve investigation.
Why should residuals center near zero?
A nonzero center suggests systematic underprediction or overprediction. Small deviations can occur through sampling variation. Persistent shifts may indicate model bias or missing structure.
Which histogram bin rule should I select?
Automatic or Freedman–Diaconis rules suit many datasets. Scott works well for smoother normal-like samples. Custom bins help compare reports consistently.
What does the KDE bandwidth control?
Bandwidth controls density curve smoothness. Smaller values reveal local detail but increase noise. Larger values create smoother curves that may hide structure.
How are residual outliers detected?
The calculator supports IQR, Z-score, and MAD methods. IQR and MAD resist extreme-value distortion. Thresholds can be adjusted for stricter or broader screening.
What does a curved normal quantile plot mean?
Curvature indicates differences from a theoretical normal distribution. Tail bending can reveal heavy tails or outliers. Systematic waves may show skewness or mixed groups.
When should residuals be standardized?
Standardization helps compare errors across different scales. It centers values and divides them by standard deviation. Raw values remain better for domain-level interpretation.
Can this plot prove a model is correct?
No single diagnostic proves model correctness. Combine this output with fitted-value, time-order, and segment checks. Validation data should guide final model decisions.