Choose your reading route
eduKateSG · Why Mathematics? · Random Survival Forests for Reliability: Bootstrap Trees, Censoring, Variable Importance and Calibration
Start with the question, audit the worked example, or jump to the assumptions and practice. Every chapter stays open for uninterrupted reading.
Understand the question
Define the quantity and follow the mechanism.Route 2 · Chapters 10–18
Reproduce the example
Audit the numbers one step at a time.Route 3 · Chapters 19–27
Check assumptions
See where design and calibration matter.Route 4 · Chapters 28–36
Explore applications
Connect the method to a concrete investigation.Route 5 · Chapters 37–44
Study and verify
Practise, inspect failure cases and read further.
Full chapter index · Practice and checking · Mathematics Learning Hub
Why is mathematics important in random survival forests for reliability? Modern assets produce many nonlinear predictors, while failure times are censored and unevenly observed. Random survival forests combine bootstrap trees with survival estimators so flexible machine learning can respect time-to-event evidence.
This guide develops survival splitting, Nelson–Aalen leaves, out-of-bag evaluation, variable importance and calibration. The examples are educational. Real deployment requires representative histories, leakage control, uncertainty and engineering review.
Full chapter index
Chapters 1–9 · Understand the question
Chapters 10–18 · Reproduce the example
Chapters 19–27 · Check assumptions
Chapters 28–36 · Explore applications
Chapters 37–44 · Study and verify
Ordinary random forests expect a fully observed label. Reliability records contain failure times and censored units whose exact lifetime is unknown. A random survival forest changes splitting, leaf estimation and evaluation so censored time-to-event data contribute without being converted into false failures.
A forest may predict a cumulative hazard H(t|x), survival S(t|x), mortality score or risk at selected horizons. These are related but not interchangeable. State the time origin, event and output before comparing models.
Each tree is usually trained on a bootstrap sample of units. With a sample of size n drawn n times with replacement, about 1-exp(-1)=63.2% of units appear at least once on average; about 36.8% are out of bag for that tree.
An out-of-bag unit was not used to fit a particular tree, so that tree can predict it. Combining only trees where the unit is out of bag provides an internal performance estimate. OOB assessment is useful, but it does not replace validation on a later or external cohort.
At each node, the algorithm considers a random subset of predictors. This decorrelates trees so averaging reduces variance. The subset size is a tuning parameter; a default is not evidence of optimality.
A log-rank split seeks child nodes with different event-time experience while accounting for risk sets and censoring. Alternative splitting rules target conservation of events, competing risks or prediction error. The choice changes what patterns the forest favours.
Tree growth stops when a node is too small, has too few events or meets a depth rule. Leaf size should be based partly on failures, not only total units. Deep leaves with one event create unstable step functions.
Within a terminal node, a cumulative hazard can be estimated by summing d_j/n_j over event times, where d_j failures occur among n_j at risk. Censored units remain in earlier risk sets and leave at censoring.
Suppose 10 units are at risk and two fail, giving hazard increment 2/10=0.20. Later eight are at risk and one fails, adding 1/8=0.125. Nelson–Aalen cumulative hazard is 0.325; exp(-0.325)=0.7225 is a common survival transformation.
| Step | Value |
|---|---|
| First increment | 2/10 = 0.20 |
| Second increment | 1/8 = 0.125 |
| Cumulative hazard | 0.325 |
| exp(-H) | 0.7225 |
| Kaplan–Meier product | 0.70 |
Using product-limit increments for the same simplified counts gives (1-2/10)(1-1/8)=0.8×0.875=0.70. Nelson–Aalen transformed survival and Kaplan–Meier are close in small increments but not identical. Report the estimator used.
Predictions are averaged across trees. Averaging cumulative hazards and then exponentiating is not always identical to averaging tree survival probabilities. Use the algorithm’s documented aggregation and verify with a small example.
Trees naturally represent thresholds and interactions without specifying them in advance. This flexibility helps when temperature, vibration and load combine nonlinearly. It can also chase noise when failures are scarce.
Most standard methods require censoring to be independent of failure conditional on observed information. If high-risk units are withdrawn after alarms, ordinary forest predictions can be biased. Model the censoring process or perform sensitivity.
Units entering after surviving to an age need delayed-entry risk sets. Many implementations support right censoring but not left truncation. Check the software rather than assuming all survival data formats are accepted.
A standard RSF built for exact failures plus right censoring does not automatically handle inspection intervals. Midpoint imputation creates invented event times. Use an interval-censored forest or a likelihood-based alternative.
When different causes preclude each other, cause-specific forests and cumulative-incidence forests answer different questions. Treating other causes as ordinary right censoring does not directly predict cumulative incidence.
The survival-model guide explains risk sets and censoring. The forest extends these ideas with recursive partitioning and aggregation.
The Cox reliability article gives interpretable proportional-hazard coefficients. Forests trade coefficient simplicity for flexible prediction.
Some implementations impute missing values during tree growth; others require preprocessing. Imputation must occur inside each resampling fold to avoid leakage. A missingness indicator can be predictive without identifying why data are missing.
High-cardinality categories offer many candidate splits and can receive unfair importance. Pool rare levels using domain rules, preserve unseen-level handling and validate across sites.
Permutation importance measures how prediction error changes when one predictor is scrambled. Correlated predictors can substitute for each other, making each appear weak. Importance is predictive, not causal.
| Layer | Question |
|---|---|
| OOB prediction | Internal error estimate |
| Calibration | Are probabilities honest? |
| Importance | Which variables affect prediction? |
| External validation | Does performance transport? |
Minimal depth summarises how near the root a variable first splits. Early variables influence larger portions of the sample. Split bias and correlation still affect the ranking.
Partial dependence averages predictions while varying one feature, sometimes creating combinations that never occur. Accumulated local effects or conditional plots may be safer with correlated variables. None proves intervention effects.
Number of trees, candidate features, node size, depth and split rule affect results. Tune within resampling and preserve the search space. More trees stabilise Monte Carlo variation but do not correct bias.
A dataset with many units but few failures still has limited information. A forest can produce elaborate patterns from sparse events. Report event counts, follow-up and prediction horizon.
At horizon t, the Brier score compares predicted survival with observed survival status using censoring weights. Lower is better. It measures combined discrimination and calibration, not mechanism truth.
Concordance measures whether higher predicted risk tends to precede lower risk. It is ranking performance. A high concordance forest can still predict probabilities that are too extreme or too mild.
Group or smooth predicted reliability against observed survival at meaningful horizons. Check calibration-in-the-large, slope and local curves. Recalibration may help after deployment drift.
An integrated Brier score averages prediction error over a declared time interval. Results depend on the interval and weighting. Do not compare scores using different horizons.
All preprocessing, feature selection and tuning must occur within training folds. Splitting rows from the same machine across folds leaks unit history. Resample whole systems, lots or sites as required.
Train on earlier units and validate on later ones to expose drift in design, maintenance and environment. Random splits can overstate deployable accuracy when calendar change matters.
Bootstrap whole units or clusters to quantify performance and prediction variability. Forest randomness is only one source. Data sampling, censoring and tuning add uncertainty.
Reproduce bootstrap inclusion near 63.2%, the leaf cumulative hazard 0.325 and transformed survival 0.7225. Check risk sets, OOB membership, aggregation and deterministic results under fixed seeds.
Compare horizon-specific calibration, Brier score and ranking on held-out systems. Review errors by load, batch and site. A useful average can hide dangerous subgroup failure.
Build three tiny survival trees from bootstrapped cards. In each leaf, calculate d/n increments. Average predictions and compare with a one-tree result. Explain why a censored card is not labelled “survived forever”.
Use several simple decision trees that ask different questions about the same set of machines. Averaging their answers shows how ensembles stabilise prediction. Ask why every tree must respect the time each machine was actually observed.
CHAPTER 37 OF 44 · Study and verify
37. Common misconception: importance means cause
A variable can predict because it proxies for environment, maintenance or selection. Permuting it measures model dependence, not what would happen if an engineer changed it.
OOB estimates share the same population, cleaning choices and tuning process. External or temporal validation remains necessary.
About one-third of units are out of bag for a typical bootstrap tree, giving the forest a built-in stream of unused predictions. This is a mathematical consequence of sampling with replacement.
Increase trees until OOB error and predictions stabilise across seeds. Extra trees usually cost computation rather than overfit in the usual sense, but tuning and biased data still matter.
Trees predict from patterns within observed feature ranges and event times. Extreme loads and long horizons need physical evidence or parametric structure.
Report endpoint, clock, censoring and entry, predictors, preprocessing, clusters, bootstrap unit, split rule, node size, trees, tuning, aggregation, importance method, horizons, calibration, Brier score, validation, uncertainty, software and seed.
Ishwaran and colleagues introduced random survival forests. Hothorn and colleagues compare survival ensembles.
Mathematics matters because flexible prediction must still respect time, censoring and uncertainty. Random survival forests combine survival estimators inside diverse trees, then demand careful calibration and validation before reliability decisions.
Extended practice laboratory
Use the cases as one connected investigation rather than twelve isolated calculations. Begin with asset-level bootstrap membership, follow one tree into a terminal node, reproduce its risk sets and leaf survival curve, and then aggregate only eligible trees for an out-of-bag prediction. Next, perturb a predictor, tune the forest inside grouped resampling and evaluate calibration on a later cohort. Preserve a compact evidence sheet containing the event definition, clock, censoring rule, sampling unit, split statistic, leaf estimator, hyperparameters and validation dates. Each line answers a different failure mode: leakage, an incorrect denominator, unstable importance or poor transport. Compare the forest with Kaplan–Meier and a simpler regression benchmark so flexibility has a meaningful reference. The completed investigation should end with two separate statements: what the model predicts and what evidence would be needed before changing maintenance. That separation is a practical use of mathematical discipline, because it stops a strong forecast from being mistaken for a tested intervention.
For a student, the key transfer is to ask who was at risk, what was observed and which data trained each prediction. For a parent, a useful conversation focuses on interpretation rather than software: why censoring is incomplete information, why a forest averages many unstable trees and why honest probabilities still need later validation. These questions connect school mathematics—fractions, exponentials, sampling and graphs—to a modern reliability workflow without suggesting that one method is automatically best.
Practice case 1: Bootstrap inclusion
Setup: Draw n items n times with replacement.
Task: Estimate unique inclusion.
Checking target: Approach 63.2% as n grows.
A bootstrap sample is not a random selection without replacement. Label the n original units, draw n labels with replacement, and count how many distinct labels appear. The chance that a particular unit is never drawn is (1-1/n)^n, which approaches exp(-1). Therefore the expected included fraction approaches 1-exp(-1), about 0.632. A small hand simulation will wobble around that limit, so do not treat 63.2% as an exact count for every tree. This calculation explains why each tree naturally leaves a sizeable out-of-bag set. Verify the result by simulating many samples at several n values, then compare the empirical mean with the formula. Keep repeated observations from the same asset together if the sampling unit is the asset; otherwise information from one history can leak into both sides of the check.
Practice case 2: Out-of-bag set
Setup: Identify units absent from one tree.
Task: Predict them using that tree.
Checking target: Do not use in-bag predictions as OOB.
For one fitted tree, mark every original unit as in bag or out of bag. An out-of-bag prediction for unit i may use only trees whose bootstrap samples excluded i. That restriction makes the prediction closer to a held-out estimate than the fitted value from all trees. It still shares feature engineering, tuning choices and data-collection quirks with the training set, so it is not an external validation. Reconstruct the membership matrix for a toy forest and average only the eligible tree predictions for each row. Then deliberately include one in-bag tree and observe how the estimate changes. In reliability data, resample at the asset or fleet-cluster level when several rows belong to one physical unit. The audit should record the sampling unit, number of eligible trees per case and whether censored histories have enough follow-up at the evaluation horizon.
Practice case 3: Hazard increment
Setup: Use d=2 and n=10.
Task: Calculate d/n.
Checking target: Obtain 0.20.
At a terminal-node event time, the Nelson–Aalen increment is d/r: failures at that time divided by units still at risk immediately beforehand. With d=2 and r=10, the increment is 0.20. Censored units can reduce later risk sets, but censoring at that instant is not added to d. Write a miniature event table with time, failures, censorings and risk set before calculating. This prevents the common mistake of dividing by the original node size at every time. If ties occur, state how events and censorings at the same recorded time are ordered by the software. Check the arithmetic independently from the fitted forest by reproducing one leaf by hand. The purpose is not to certify the entire model from one node; it is to verify that the leaf estimator respects the event process that the model claims to represent.
Practice case 4: Cumulative hazard
Setup: Add 0.20 and 0.125.
Task: Calculate H.
Checking target: Obtain 0.325.
Cumulative hazard adds event-time increments. If the first two increments are 0.20 and 0.125, H is 0.325 after the second event time. The sum is dimensionless even though the underlying time scale may be hours, cycles or days. Do not add increments after a requested prediction horizon, and do not mix clocks across assets. Build the full risk-set table before summing so every denominator can be traced. A useful software check is to compare the manually accumulated curve with the leaf curve returned by the library at every event time, rather than checking only its endpoint. If they disagree, inspect delayed entry, tied times, weights and the convention for observations that fail or censor on the boundary. This case develops the habit of auditing the path of a calculation, not merely accepting one final probability.
Practice case 5: Survival transform
Setup: Use H=0.325.
Task: Calculate exp(-H).
Checking target: Obtain about 0.7225.
The common survival transform S(t)=exp[-H(t)] converts a nonnegative cumulative hazard into a number between zero and one. For H=0.325, the result is about 0.7225. This transformation describes the Nelson–Aalen-based survival estimate used in many survival-forest implementations; it is not identical to a Kaplan–Meier product in a small leaf. Keep enough precision in H before exponentiating, then round only the reported survival. Test three edge cases: H=0 should give one, a larger H should give a smaller survival, and no finite H should produce a negative value. Also label the horizon and event, because 0.7225 is meaningless without them. In an application, compare predicted survival with observed outcomes using censoring-aware calibration rather than treating the mathematical range check as evidence that the probability is empirically honest.
Practice case 6: Product limit
Setup: Use 2/10 then 1/8.
Task: Calculate survival.
Checking target: Obtain 0.70 and name the estimator.
For the same toy node, Kaplan–Meier multiplies conditional survival factors. Two failures among ten give 1-2/10=0.8; one later failure among eight gives 1-1/8=0.875; the product is 0.70. Nelson–Aalen followed by exp(-H) gives about 0.7225, so the two valid estimators need not match exactly in a small sample. Name the estimator instead of reporting a bare survival number. Recalculate after changing one censoring time and explain why only later risk sets move. This comparison teaches a broader lesson about model documentation: two packages can both be correct while implementing different estimators. A reproducible report therefore records the leaf estimator, tie convention and any smoothing or interpolation. External calibration should use the exact output produced by the deployed pipeline, not a hand-swapped alternative that looks numerically similar.
Practice case 7: Censoring
Setup: Remove one unit at censoring.
Task: Update later risk sets.
Checking target: Do not count a failure.
A censored observation tells us that the event was not observed up to its censoring time; it does not say the unit failed then. In a leaf table, keep the unit in the risk set before censoring and remove it from later denominators. Repeat the hazard calculation after moving that censoring earlier and identify exactly which increments change. The usual independent-censoring condition is an assumption about what remains unobserved after conditioning on available predictors. If inspection loss, decommissioning or fleet transfer is related to latent deterioration, that condition may be doubtful. Compare follow-up patterns across important predictor groups and consider sensitivity analyses or richer observation models. A forest cannot repair a biased observation process merely by growing more trees. Record administrative cut-off dates separately from informative exits so reviewers can see which source of censoring dominates.
Practice case 8: Importance
Setup: Permute a correlated predictor.
Task: Measure error change.
Checking target: Do not interpret as a causal effect.
Permutation importance asks how much predictive performance worsens when one predictor is disrupted. Correlated variables can substitute for each other, so permuting one may show little loss even when the shared signal is useful. Conversely, permuting an operational variable can create unrealistic combinations outside the data-generating process. Calculate importance on out-of-bag or held-out predictions with a censoring-aware metric, repeat the permutation to quantify Monte Carlo variation, and report correlated groups rather than a single league table. Then compare with minimal depth or grouped permutation as a robustness check. Most importantly, predictive importance is not an intervention effect: a sensor can forecast failure because it responds to damage without causing the damage. Use this exercise to separate the question 'what helps prediction?' from 'what would reduce failures if changed?'.
Practice case 9: Tuning
Setup: Vary node size and feature subset.
Task: Use inner resampling.
Checking target: Keep the outer assessment untouched.
Node size, candidate-feature count and number of trees control different parts of the forest. Smaller terminal nodes can capture local structure but leave unstable survival estimates; larger feature subsets can make trees more similar; too few trees leave Monte Carlo noise. Tune choices inside resampling that preserves asset histories and time order. Plot error and calibration against the number of trees to check stabilisation rather than selecting a round number by habit. If several hyperparameter settings perform similarly, prefer the one with more stable calibration and simpler operational behaviour. Keep a final temporal or external set untouched until all choices are fixed. The audit record should include the search space, metric, horizon, random seeds and selection rule. Without that record, a seemingly objective forest can hide many informal attempts that inflate its reported performance.
Practice case 10: Calibration
Setup: Group horizon predictions.
Task: Compare with observed survival.
Checking target: Show uncertainty and data density.
Calibration at a chosen horizon compares predicted survival with observed survival for comparable units. Sort or smooth predictions only after deciding how censoring will be handled, and show how many observations support each region. A decile plot can be useful, but empty or tiny groups make its shape unstable. Add calibration-in-the-large and a slope or flexible curve with uncertainty. Repeat the analysis at several operational horizons because a model may be honest at 30 days and biased at one year. If recalibration is learned, fit it only on training or calibration data and evaluate it later. Do not infer safety from a curve close to the diagonal when rare, high-consequence subgroups are poorly represented. The practical check is whether predicted probabilities retain meaning in the population, clock and data-collection process where decisions will actually be made.
Practice case 11: Temporal validation
Setup: Train earlier and test later.
Task: Measure drift.
Checking target: Keep unit histories together.
Temporal validation trains on earlier histories and tests on later ones, matching the direction of real deployment. Split by calendar time and keep every record from one asset on one side. Measure both discrimination and calibration, then stratify performance by fleet, usage and sensor regime to locate drift. A later period may contain fewer observed failures simply because follow-up is shorter, so align evaluation horizons and censoring support before comparing scores. Record changes in maintenance policy, hardware, firmware and failure coding; these can move the target even if predictor distributions look stable. A strong random split and a weak temporal split are not contradictory results—the latter exposes transport risk. Use the discrepancy to decide whether the model needs recalibration, retraining, new predictors or a narrower deployment claim.
Practice case 12: Conclusion
Setup: State output, horizon and censoring.
Task: Report calibration and uncertainty.
Checking target: Separate prediction from intervention.
A responsible conclusion names the event, time origin, horizon and output before quoting performance. Report how censoring, delayed entry and repeated histories were handled; distinguish out-of-bag estimates from external or later-cohort validation; and include calibration beside ranking metrics. Variable importance should be described as predictive evidence with uncertainty, not as proof of a cause or maintenance benefit. State where the training population lacks support and which monitoring signal would trigger review. Finally, separate prediction from action: a high-risk forecast may prioritise inspection, but the benefit of that inspection requires its own causal or experimental evidence. A concise model card can capture these limits, software versions, hyperparameters and data dates. The mathematics earns trust when another analyst can reproduce the curve and when decision-makers can see what the curve does—and does not—justify.