Skip to main content

Kotlin Notebook

Try this guide as a Kotlin Notebook with Kandy visualizations — run the cells to see charts and explore the data interactively.
This guide uses temperature sensor readings from a manufacturing line to demonstrate anomaly detection, control limit computation, and process stability testing.

Process Data

Anomaly Detection

Baseline statistics

Z-score method

Flag readings more than 3 standard deviations from the mean.

Percentile-based detection

Flag readings outside the 1st and 99th percentiles.

Control Limits

Compute mean ± 3σ boundaries.

Batch Stability

Compare readings from two production batches to verify the process has not shifted.

Multiple batches

Distribution Fit

Verify that readings follow the expected distribution.
After fitting a process distribution, use quantile() to set thresholds: fitted.quantile(0.001) and fitted.quantile(0.999) give 99.8% coverage bounds.

Multi-Parameter Monitoring

When monitoring several sensors, check correlations between them.
Strong correlations between sensor readings can indicate shared root causes when one parameter drifts out of control.
Last modified on April 18, 2026