Least Trimmed Squares Calculator

Handle noisy data through robust trimming and stability. Review coefficients, residuals, inliers, and comparison metrics. Plot results, export reports, and interpret patterns with confidence.

Calculator Input

Enter one pair per line. Commas, spaces, tabs, or semicolons are accepted.
Higher trimming protects the line from stronger outlier influence, but it also retains fewer observations.

Actions

This page estimates a robust simple linear regression model. It searches for a low trimmed residual sum, then refines the retained subset.

Reset Form

What appears after calculation

  • Robust line coefficients
  • Classical OLS comparison
  • Trimmed and retained counts
  • Prediction output if x is supplied
  • Diagnostics table and export files

Formula Used

Least trimmed squares fits the line yi = β0 + β1xi + εi while reducing outlier impact.

Residual: ri = yi − (β0 + β1xi)

Ordered squared residuals:(1) ≤ r²(2) ≤ ... ≤ r²(n)

LTS objective: minimize Σ from i = 1 to h of r²(i)

Retained subset size: h = max( ceil((n + 3) / 2), floor(n × (1 − trim%)) )

Refit step: after selecting the h smallest residuals, OLS is refit on that retained subset.

This implementation targets simple linear regression. It also reports the ordinary least squares line on all observations so you can compare sensitivity to outliers.

How to Use This Calculator

  1. Enter one x,y pair on each line in the dataset box.
  2. Choose a trim percentage that reflects expected contamination.
  3. Set concentration steps for refinement and add an optional prediction x value.
  4. Press the calculate button to view the robust line, graph, diagnostics, and exports.

Example Data Table

This sample illustrates one strong outlier near x = 8. A robust trimmed method should down-weight its influence relative to OLS.

Observation X Y Comment
112.2Regular point
224.3Regular point
335.9Regular point
448.1Regular point
5510.4Regular point
6612.2Regular point
7713.8Regular point
8831.0Likely outlier
9918.2Regular point
101020.1Regular point

Frequently Asked Questions

1) What does least trimmed squares do?

It fits a regression line using only the smallest squared residuals. Large-residual observations are temporarily excluded, so extreme outliers affect the line far less.

2) How is this different from ordinary least squares?

OLS uses every squared residual, so one extreme point can pull the line strongly. LTS keeps only the best-fitting subset and is therefore much more resistant.

3) What is the retained subset h?

h is the number of observations kept inside the trimmed objective. Larger h uses more data, while smaller h increases resistance to contamination.

4) How should I choose the trim percentage?

Start near 10% to 20% when you expect a few unusual points. Increase trimming only when contamination looks substantial, because heavy trimming also discards information.

5) Why do LTS and OLS predictions differ?

The LTS line resists outliers, while OLS follows all points. When unusual observations exist, slope and intercept can diverge, producing different predictions.

6) Can this page handle multiple predictors?

No. This version is built for a single predictor x and one response y. It is ideal for robust simple linear regression analysis.

7) What does the robust scale value mean?

It summarizes the typical size of retained residuals using a robust median-based measure. Smaller values indicate tighter agreement around the resistant line.

8) When should I avoid trimming too much?

Avoid heavy trimming when the data are already clean or when the sample is small. Over-trimming can remove genuine structure and make estimates less stable.

Related Calculators

m-estimator regressionwinsorized mean calculatorrobust covariance estimatorrobust outlier detectionrobust logistic regressionbiweight midvariancerobust location estimatorrobust quantile regressionhuber m estimatorrobust covariance matrix

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.