Detrending Calculator — Advanced

❓Detrend 🏠Home 🧮Basic Video
📘 How to use this — copy and paste CSV, TSV, or spreadsheet data

What this page adds. The basic calculator removes a mean, a line or a polynomial up to order 5 in your browser, on up to three columns. This page takes any number of columns, polynomials up to order 10, and adds asymmetric least squares (ALS) - the baseline that stays under peaks. To do that it sends your table to the server, computes there, and sends the numbers back. Nothing is stored, but the data does leave your machine. If that matters for your data, use the basic page. The detrending article explains each method and how to set λ and p.

ALS needs evenly spaced x, within 0.1%, in every column it fits. Uneven x is refused, naming the first x that breaks the step. Mean, linear and polynomial take any spacing.

  1. Paste your data into the Input grid — straight from a spreadsheet, or as CSV/TSV text — or import a file. First column is x, then one column per series: y1, y2, … Rows are sorted by x.
  2. Pick a method. Only its own parameters are shown.
    • mean, linear: no parameter.
    • polynomial: order 0 to 10. Keep it low - 2 to 4 - when the data has peaks.
    • ALS: three parameters.
      • λ, 1 to 10¹²: stiffness. Larger is straighter. ▲▼ step by a factor of 10.
      • p, 0.001 to 0.5: the weight of a point above the baseline. Smaller lets peaks go.
      • iterations, 1 to 50: rounds of reweighting.
  3. Real time range — try parameters live on order, λ, p and iterations.
    • ▲▼ buttons or the mouse wheel over a box: the value moves and the result is recomputed shortly after the last step - one request to the server, not one per step.
    • Digit wheel: over the box, the wheel steps the digit just left of the mouse pointer - in 0.010, pointer after the 1 steps 0.01, after the last 0 steps 0.001. Before the first digit, the wheel multiplies or divides by 10.
    • λ is written in scientific notation (1.0e3): the digit wheel works on 1.0, the exponent changes by one over the e3 part, and ▲▼ step by a factor of 10.
    • Limits: each value stays within its range; a typed value outside it is set to the nearest limit.
    • Typing or the arrow keys change the box only; press detrend to recompute.
  4. Press detrend. The upper chart shows your data as dots and each baseline as a line in the same colour; the lower chart shows the detrended data over a zero line. The server's time for the fit shows beside the button.
  5. Read the result. The Output grid lists x, then the baseline and the detrended value for each y column. Baseline plus detrended equals your input. Export saves it as a CSV/TSV file.

Input

Output

Data and baseline

Detrended