Horizon

See when a health indicator may reach its threshold, with an uncertainty band.

Horizon in half a minute

How to read the time left to threshold and its uncertainty.

Read the transcript

When will a worn part reach its limit? A single date hides how uncertain that answer is. Horizon tracks a health indicator, such as vibration or pressure drop, and filters out the noise. A Kalman trend model estimates the rate of wear, and thousands of simulated futures show the spread. You read a window, not a date: early, likely, late. Enter your planning lead time, and the forecast becomes a decision. Load your own series, or try a scenario. The forecast is a guide, not a guarantee.

Narration: synthetic voice (Piper, voice “Joe”, CC0 public domain). Captions are burned into the video.

In three steps.

Tracks the trend
Projects with uncertainty
Reads a range
1

Data

Pick a scenario. All are mathematically generated examples, not real machine data.

My own health indicator

Drop a CSV file here

One numeric column: the row number is the time. With a date column, elapsed days are used.

Record details
2

Settings

The time your team needs to prepare. The forecast is read against this time.

Advanced settings
Direction
Simulated paths

Forecast: measurements and future band

Pale: measured. Dark: level. Band: likely path (P10–P90).

When does it cross?

Bars: simulated paths crossing in each window. Colours: zones versus lead time.

The needle compares the most likely crossing (P50) with the planning lead time.

Is it speeding up?

If the line moves away from zero in the direction of degradation, degradation is speeding up. Shade: ±2 standard deviations.

Do the models agree?

Bars: error on the last 20% (RMSE; lower is better).

Export

How do I read the result?

  1. Pale line: measurement
  2. Dark line: smoothed level
  3. Shade: P10–P90 band
  4. Dashed: threshold
  5. Red, amber, green: against lead time
Horizon assumes the degradation trend continues; maintenance, regime changes or sudden damage break the forecast, and it is not a guarantee.

How it computes

Six steps: prepare the series and the threshold, track the trend with a damped Kalman filter, project the future by simulation, read the crossing times as percentiles, compare with two simple models, then apply the decision rules.

  1. The series and the threshold

    thresholdfirst pointnowhorizonH ≥ 2 × elapsed time
    Schematic: measurements, now, and the look-ahead horizon. In automatic mode the horizon is at least twice the elapsed time.

    Each row is one time point, and at least 12 are needed. The direction comes from the overall trend; the threshold is the value where the function is lost. On your own data the threshold is pre-filled automatically: that is only a starting point, so replace it with your real limit.

    Technical detail
    Δt=mediani⁡(ti−ti−1)\Delta t = \operatorname{median}_i \left( t_i - t_{i-1} \right)

    Median of successive time gaps: the typical spacing between points.

    E=tn−t1E = t_n - t_1

    Elapsed time.

    H=max(2E,50Δt)H = \max\left( 2E,\; 50\,\Delta t \right)

    In automatic mode H is at least 2E and at least 50 spacings. In manual mode H = h·Δt, with h between 50 and 400 steps.

    Ns=min(400,max(2,⌈HΔt⌉))N_s = \min\left( 400,\; \max\left( 2,\; \left\lceil \frac{H}{\Delta t} \right\rceil \right) \right)

    Number of simulation steps; at most 400.

    δt=HNs\delta t = \frac{H}{N_s}

    Length of one simulation step.

    Δt\Delta t
    median time gap
    EE
    elapsed time, t_n − t_1
    HH
    horizon: time looked ahead from now
    hh
    manual horizon steps 50 – 400
    δt\delta t
    simulation step
    SettingValueNote
    Minimum points12for the model; the model comparison needs 20 or more
    Maximum points1,500longer series are reduced to groups of equal row count, each averaged
    Steps N_s2 – 400at most 400 steps
    Direction±1falls if Σ(t − t̄)(y − ȳ) < 0, rises otherwise

    Source horizon/horizon.js · wasm/kutupml.js

  2. Damped Kalman trend model

    00.510T2Thorizonshare of rate leftκT = 0κT = 0.3κT = 3
    Schematic: how damping shrinks the rate (horizontal axis: time in units of the observed span T). Example κT values: 0 (no damping), 0.3 (start of the automatic search), 3 (strong damping).

    The indicator is tracked with two numbers: the current level and the degradation rate. At each new measurement the filter corrects both and removes measurement noise. The rate is damped: strong damping flattens the forecast, weak damping lets the degradation rate carry on.

    Technical detail
    ℓt+Δt=ℓt+Δtbt+wt(ℓ)\ell_{t+\Delta t} = \ell_t + \Delta t\, b_t + w^{(\ell)}_t

    State equation, level: the level moves at the rate.

    bt+Δt=e−κΔtbt+wt(b)b_{t+\Delta t} = e^{-\kappa \Delta t}\, b_t + w^{(b)}_t

    State equation, rate: it decays by e−κΔt per step; with κ = 0 it stays constant.

    Var⁡(wt(ℓ))=qℓΔt+qs(Δt)33\operatorname{Var}\left( w^{(\ell)}_t \right) = q_\ell\, \Delta t + \frac{q_s\, \left( \Delta t \right)^3}{3}

    The process-noise covariance Q is a 2 × 2 matrix; its three entries are given by these equations.

    Var⁡(wt(b))=qsΔt\operatorname{Var}\left( w^{(b)}_t \right) = q_s\, \Delta t
    Cov⁡(wt(ℓ),wt(b))=qs(Δt)22\operatorname{Cov}\left( w^{(\ell)}_t, w^{(b)}_t \right) = \frac{q_s\, \left( \Delta t \right)^2}{2}
    yt=ℓt+vty_t = \ell_t + v_tvt∼𝒩(0,R)v_t \sim \mathcal{N}(0,\, R)

    Measurement: observed value = level plus measurement noise.

    εt=yt−ℓt∣t−1\varepsilon_t = y_t - \ell_{t \mid t-1}

    Innovation ε: the prediction error.

    St=Pt∣t−1ℓℓ+RS_t = P^{\ell\ell}_{t \mid t-1} + R

    S: variance of the innovation.

    ℓt∣t=ℓt∣t−1+Pt∣t−1ℓℓStεt\ell_{t \mid t} = \ell_{t \mid t-1} + \frac{P^{\ell\ell}_{t \mid t-1}}{S_t}\, \varepsilon_t

    Correction; the rate is corrected the same way, with Pℓb.

    ln⁡ℒ=−12∑t(lnSt+εt2St+ln2π)\ln \mathcal{L} = -\frac{1}{2} \sum_{t} \left( \ln S_t + \frac{\varepsilon_t^2}{S_t} + \ln 2\pi \right)

    Likelihood: in automatic mode q_ℓ, q_s, R and κ are searched to maximise this value.

    xt∣T=xt∣t+Gtdt\mathbf{x}_{t \mid T} = \mathbf{x}_{t \mid t} + G_t\, d_t

    The level and rate on the chart come from a backward RTS smoother; at the last point they equal the filtered values, where the forecast starts.

    dt=xt+1∣T−xt+1∣td_t = \mathbf{x}_{t+1 \mid T} - \mathbf{x}_{t+1 \mid t}

    Backward difference: between the smoothed and the predicted state.

    Gt=Pt∣tF⊤Pt+1∣t−1G_t = P_{t \mid t}\, F^{\top} P_{t+1 \mid t}^{-1}

    RTS gain.

    ℓ,b\ell,\; b
    level and degradation rate
    κ\kappa
    damping; κ = κT / T
    w(ℓ),w(b)w^{(\ell)},\; w^{(b)}
    process noises (zero mean)
    vv
    measurement noise
    qℓ,qs,Rq_\ell,\; q_s,\; R
    noise levels (tuned by likelihood)
    PP
    state covariance; Pℓℓ, Pℓb, Pbb
    F,GF,\; G
    transition matrix (level row 1, Δt; rate row 0, e−κΔt) and RTS gain
    TT
    observed span, t_n − t_1
    SettingValueNote
    Initial stateOLSfirst at most 6 points; Pℓℓ = R + 10⁻⁶·range², Pbb = (range / T)², Pℓb = 0
    Noise startr₀ = (1.4826·MAD)² / 2MAD: median absolute deviation of successive differences; R = r₀
    Other starts10⁻³·r₀·Δt̄ · 10⁻⁴·r₀/Δt̄ · κT = 0.3Δt̄ = T / (n − 1); starts for q_ℓ, q_s, κT
    SearchNelder–Mead≤ 260 iterations; log q_ℓ, log q_s, log R ∈ [−40, 25]; log κT ∈ [−7, 3.5]
    Manual modeκ = 0q_ℓ, q_s and R are typed in; the rate behaves as a random walk

    Source dev/native/kutupml.c · wasm/kutupml.js · horizon/horizon.js

  3. Simulating the future (Monte Carlo)

    0.511.5nowT2Ttime
    Schematic: 30 paths with example parameters. Paths that reach the threshold are coloured, the others faint; dots mark the crossing moments; the red line is the threshold.

    Starting from today’s uncertain level and rate, 500 to 1,200 possible futures are drawn forward (default 1,000). Each path moves in steps: the level changes at the current rate, the rate fades, and random noise is added at each step. The moment a path first reaches the threshold, that time is recorded.

    Technical detail

    For intuition only: without noise and damping the level would move in a straight line, and the time left would be roughly the formula below. Horizon does not compute this; it only gives a simple comparison.

    RUL≈L−ℓb\mathrm{RUL} \approx \frac{L - \ell}{b}

    Noise-free, undamped straight-line assumption. L: threshold; ℓ: level; b: rate.

    ℓ0(p)=ℓT+M11z1\ell^{(p)}_0 = \ell_T + M_{11}\, z_1

    Start: z are independent standard normal draws.

    b0(p)=bT+M21z1+M22z2b^{(p)}_0 = b_T + M_{21}\, z_1 + M_{22}\, z_2

    M is the Cholesky factor of the last filtered covariance: M11 = √Pℓℓ, M21 = Pℓb / M11, M22 = √(Pbb − M21²).

    ℓh+1(p)=ℓh(p)+δtbh(p)+uh(ℓ)\ell^{(p)}_{h+1} = \ell^{(p)}_h + \delta t\, b^{(p)}_h + u^{(\ell)}_h

    Each step uses the same state equations, with δt in place of Δt.

    bh+1(p)=e−κδtbh(p)+uh(b)b^{(p)}_{h+1} = e^{-\kappa\, \delta t}\, b^{(p)}_h + u^{(b)}_h

    u is noise with covariance Q(δt), drawn through its Cholesky factor.

    τ(p)=(h+f)δt\tau^{(p)} = \left( h + f \right) \delta t

    Crossing time: h is the first step in which ℓh+1 passes the threshold; f is the linear interpolation inside that step.

    f=L−ℓhℓh+1−ℓhf = \frac{L - \ell_h}{\ell_{h+1} - \ell_h}

    For falling indicators the comparison is ≤.

    ℓT,bT\ell_T,\; b_T
    last filtered level and rate (now)
    MM
    Cholesky factor
    z,uz,\; u
    standard normal draw; process noise
    NpN_p
    number of paths 500 · 1,000 · 1,200
    hh
    step index (from 0)
    SettingValueNote
    Paths N_p1,000500, 1,000 or 1,200 can be chosen
    Seed7the same seed and input give the same result
    StepsN_s ≤ 400δt = H / N_s
    Already crossedP(crossing) = 1if the latest level is already beyond the threshold, no simulation runs; the percentiles show 0

    Source dev/native/kutupml.c · horizon/horizon.js

  4. P10, P50, P90 and P(crossing)

    00.51nowT2Ttime elapsedshareP10P50P90beyond horizonP(crossing)
    Schematic: 1,000 paths with example parameters. The curve shows the share of paths crossed by each time; dashed lines sit at 0.1, 0.5 and 0.9.

    The percentiles of the crossing times over all paths are read. P50 is the crossing time in the middle of the spread; P10 and P90 are its lower and upper ends. Paths that never reach the threshold within the horizon are placed last. P(crossing) is the share of paths that cross within the horizon.

    Technical detail
    Pq=τ(⌊qNp⌋)P_q = \tau_{(\lfloor q\, N_p \rfloor)}

    τ(k)\tau_{(k)}: the k-th smallest crossing time of all paths, counting from 0; non-crossing paths count as ∞. PqP_q is defined only if position ⌊qNp⌋\lfloor q N_p \rfloor falls among the crossing paths; otherwise “beyond horizon”.

    Pcrossing=#{p:τp≤H}Np\mathrm{P}_{\mathrm{crossing}} = \frac{\#\{\, p : \tau_p \le H \,\}}{N_p}

    Share of paths that cross within the horizon.

    pctq(ℓh)\mathrm{pct}_q\left( \ell_h \right)

    Level band: the q percentile of the paths’ levels at each step (linear interpolation). It is a different thing from the crossing-time percentiles.

    SettingValueNote
    P10·P50·P90P_{10} \cdot P_{50} \cdot P_{90}⌊0.1Np⌋\lfloor 0.1\, N_p \rfloor · ⌊0.5Np⌋\lfloor 0.5\, N_p \rfloor · ⌊0.9Np⌋\lfloor 0.9\, N_p \rfloorread directly from the sorted crossing times; no interpolation
    P10–P90 range≈ 80%only when both ends are defined; otherwise “beyond horizon”
    Level bandeach steplinear interpolation over path levels; shaded on the chart

    Source dev/native/kutupml.c · horizon/horizon.js · wasm/kutupml.js

  5. Two simple models and the hold-out check

    trainingtest
    Schematic: 10-point example. The line is fitted to the first 8 points (training, 80%); the gaps at the last 2 (test, 20%) make up the error (RMSE).

    A straight line and a quadratic curve are fitted to the same data and extended into the future. To judge which predicts the future better, the last 20% of the points are held back and predicted (hold-out). The model with the lowest error drives the forecast; the three distributions are combined with weights.

    Technical detail
    xi=ti−tnx_i = t_i - t_n

    Time is measured from the last point.

    yi=c0+c1xi+c2xi2y_i = c_0 + c_1\, x_i + c_2\, x_i^2

    Least squares: c0c_0 is the current value; for the linear model c2=0c_2 = 0.

    βˆ=(X⊤X)−1X⊤y\hat{\beta} = \left( X^{\top} X \right)^{-1} X^{\top} y

    Least-squares solution.

    Cov⁡(βˆ)=s2(X⊤X)−1\operatorname{Cov}(\hat{\beta}) = s^2 \left( X^{\top} X \right)^{-1}

    The covariance is the uncertainty of the coefficients.

    s2=RSSn−ms^2 = \frac{\mathrm{RSS}}{n - m}

    m: number of coefficients (linear 2, quadratic 3).

    β(p)∼𝒩(βˆ,Cov⁡(βˆ))\beta^{(p)} \sim \mathcal{N}\left( \hat{\beta},\, \operatorname{Cov}(\hat{\beta}) \right)

    For each path the coefficients are drawn from this distribution.

    c0+c1t+c2t2=Lc_0 + c_1 t + c_2 t^2 = L

    The time t where the curve meets the threshold is solved. Only roots with 0 ≤ t ≤ H and a slope in the crossing direction are kept; for the quadratic, the smallest non-negative root, otherwise the larger one.

    ne=⌊0.8n⌋n_e = \lfloor 0.8\, n \rfloor

    Number of training points; the remaining points are the hold-out.

    RMSE=1n−ne∑i>ne(yi−yˆi)2\mathrm{RMSE} = \sqrt{\frac{1}{n - n_e} \sum_{i > n_e} \left( y_i - \hat{y}_i \right)^2}

    Hold-out error: fitted on the first n_e points and measured on the rest.

    ℓˆi=ℓˆi−1+Δtibˆi−1\hat{\ell}_i = \hat{\ell}_{i-1} + \Delta t_i\, \hat{b}_{i-1}

    Kalman hold-out: run forward from the last filtered state, without noise.

    bˆi=e−κΔtibˆi−1\hat{b}_i = e^{-\kappa \Delta t_i}\, \hat{b}_{i-1}
    wm=1/RMSEm2∑k1/RMSEk2w_m = \frac{1 / \mathrm{RMSE}_m^{2}}{\sum_{k} 1 / \mathrm{RMSE}_k^{2}}

    Combined distribution: weighted by the inverse squared error; without a comparison the weights are equal.

    F(t)=∑mwm#{p:τp(m)≤t}NpF(t) = \sum_{m} w_m\, \frac{\#\{\, p : \tau^{(m)}_p \le t \,\}}{N_p}

    F is evaluated on 401 points; the combined percentiles are read from F.

    argminmRMSEm\operatorname*{argmin}_{m}\, \mathrm{RMSE}_m

    Driver model: the model with the lowest RMSE. The main forecast and the verdict are read from its distribution; without a comparison the Kalman model drives.

    c0,c1,c2c_0,\; c_1,\; c_2
    curve coefficients (c0c_0: current value)
    X,yX,\; y
    design matrix and measurements
    n,nen,\; n_e
    number of points; number of points used for training
    wmw_m
    weight of model m in the combined distribution
    τp(m)\tau^{(m)}_p
    crossing time of path p of model m
    SettingValueNote
    Modelslinear · quadratic · Kalmancomparison needs at least 20 points; with fewer, Kalman drives
    Hold-out share20%first ⌊0.8n⌋ points train; the rest test
    Paths (linear, quadratic)min(2,000, N_p)coefficient draws
    Curve bandcoefficient uncertaintyno future noise is added to the linear and quadratic bands; the band can look narrow

    Source dev/native/kutupml.c · horizon/horizon.js · wasm/kutupml.js

  6. Decision rules

    0L2Lhorizonbefore LL–2Lafter 2LP10P50
    Schematic: planning lead time L; zones before L, L–2L and after 2L. The positions of P10 and P50 are examples.

    The verdict follows five rules, tried in order; the first that holds decides. The planning lead time L is compared with P10 (the early edge) and with P50 (the most likely time).

    Technical detail
    1. Attention: the smoothed latest level is already beyond the threshold. The model gives no future crossing time; check the measurements and the data feed.
    2. Attention: P10<LP_{10} < L; the crossing may come before the team can prepare.
    3. No crossing expected: Pcrossing<0.5\mathrm{P}_{\mathrm{crossing}} < 0.5; no crossing within the horizon. This holds for this data and model only; it does not prove the machine is healthy.
    4. Watch: P50<2LP_{50} < 2L; the most likely crossing is less than twice the lead time.
    5. Time to plan: if none of the above applies.

    Extra warning: if the models’ P50 values differ by more than 20%, or one model’s P50 is undefined while the driver’s is defined, the text asks you to read the range as wider than shown.

    SettingValueNote
    Lead time L14in the chosen unit (days, hours, cycles or samples)
    Rule 3 limit0.5crossing probability
    Rule 4 multiplier2 × Lwatch limit
    Model spread20%warning limit for the spread of the P50 values

    Source horizon/horizon.js

Terms used on this page

Health indicator (HI)
Any number that moves towards failure as the machine degrades: vibration RMS, filter differential pressure, tool wear. It is suitable when it trends towards the threshold.
Remaining useful life (RUL)
The time from now until the indicator first crosses its threshold. Horizon gives this time as a distribution rather than a single date.
Kalman filter
A model that filters measurement noise and estimates the level and the rate together. Here the indicator is tracked as a damped local linear trend.
Damping (κ)
The rate at which the degradation rate fades over time. κ = 0 keeps the rate constant (manual mode). In automatic mode it is learned from the data; with strong damping the forecast flattens.
P10 · P50 · P90
Percentiles of the simulated crossing times. Paths that do not cross within the horizon are placed last. The P10–P90 range covers about 8 in 10 simulated futures when both ends are defined. P50 is the time by which half of the paths have crossed; it is undefined unless more than half cross.
Threshold
The value where the function is lost, i.e. the failure. It should come from the manufacturer or process limit, not from a statistical average. On your own data the automatic value is only a starting point.
Planning lead time
The time the team needs before failure to raise a work order, get a part or stop the machine. The decision comes from comparing the forecast with this time.
RMSE
Root mean square error: the square root of the mean of the squared forecast errors. A lower value means a better fit, and it has the same unit as the indicator.
Driver model
The model with the lowest hold-out error. The main forecast, the charts and the verdict are read from its distribution; the other models are shown for comparison.
Hold-out test
Testing a model on the last part of the data (about 20%), which it did not train on. A model that predicts new data well is considered more reliable.

Frequently asked

What should I use as a health indicator?

Pick a measurable quantity that moves in one direction as the machine degrades: vibration RMS, filter differential pressure, a wear measurement. It should reflect the degradation mechanism, and the threshold should be the value where the function is lost, on the same indicator.

Why a range and not a date?

The future is uncertain because of load, maintenance, environment and noise, and a single date hides that. The P10–P90 band carries the uncertainty of the level and rate and the process noise. It does not show the uncertainty of the fitted parameters or the measurement noise, and it does not cover effects the model does not contain, such as sudden damage.

How much history is needed?

There is no fixed number. In practice a few hundred points and a clear trend help; a short record that is only noise gives a weak forecast. Earlier failures and the trend before them are very valuable. At least 12 points are needed; the model comparison runs from 20 points.

What does the planning lead time do?

Horizon compares the most likely crossing (P50) and the early edge (P10) with your planning lead time. If the smoothed latest level is already beyond the threshold, it says Attention. Otherwise it first checks the probability of crossing within the horizon: below one half it says No crossing expected. Otherwise, if P10 is shorter than the lead time it raises Attention: at least one in ten simulated futures crosses before that time. If the most likely crossing is less than twice the lead time, it says Watch. Changing the lead time changes the decision, not the event.

Is my data uploaded?

No. The calculation runs in your browser in a WebAssembly module written in C. Nothing is sent anywhere and it is gone when you close the page. Files you export stay with you.

Go deeper.

Full library

Related questions

All questions
ASP Dijital

Start with a production problem.

Let’s review your data source, your existing system and the decision you want to improve.

Discuss your project ↗