measurement_stats
Aggregate .MEAS results across sweep or Monte Carlo runs to compute min, max, mean, median, std, percentiles, and worst-case step indices from simulation logs.
Instructions
Use to AGGREGATE .MEAS scalar results across a .step sweep or Monte Carlo run. Answers questions like 'across 100 MC trials, what's the worst-case rise time?' or 'how does gain vary as R sweeps 1k..10k?'. Inputs the .log file produced by the run.
Returns per-measurement: min, max, mean, median, std, p10, p90, best_step_index (argmin) and worst_step_index (argmax), failure count, and an optional histogram (set histogram_bins=0 to skip).
Accepts any job id: a sweep/MC batch aggregates across its runs; a single-simulation job aggregates its own log (one value per step for a .step run). Axis choice differs by shape: a batch detects WHEN-style .MEAS (constant level, varying crossing) and swaps to aggregating the 'at' field; a stepped single-run log always aggregates the 'value' field. The aggregated_field output says which was used. On a plain single run there's only one value per measurement, so stats collapse to n=1 — use simulation_summary instead to just read the scalars.
Works with .MEAS from any analysis type (.tran/.ac/.dc/.op) — the measurement directives themselves embed the analysis context. Pass measurement=NAME to aggregate just one; otherwise returns all .MEAS in the log.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log_file | No | Path to .log file from a single ``.step`` run that already concatenates every step's .MEAS results. For Monte Carlo / multi-run sweep jobs that emit one log per run, pass ``job_id`` instead and the aggregator walks every run's log. | |
| job_id | No | Job ID. For a batch job (``run_montecarlo`` / ``run_sweep``) the tool loads each completed run's log, concatenates the .MEAS results (one row per run), and aggregates. For a completed single-simulation job it aggregates that run's log (per-step values for a .step run). Mutually exclusive with ``log_file``. | |
| measurement | No | If given, stats for only this .MEAS; otherwise all measurements. | |
| histogram_bins | No | Histogram bin count. Set to 0 to skip histogram computation. | |
| format | No | 'json' or 'text' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stats | Yes |