name: op-agg-vec-sd
description: Per-member sample standard deviation of a vector — one spread per member, in member order (how much a group disagrees on each item).
kind: operator
category: AGG
operator: AGG_VEC_SD
type: reference
applies_to: process, compose, predict
examples_tags: [multivariate, streaming-friendly]
Use when
Standard deviation of each item of a battery or mix, as one list per group: how much the group’s rows disagree on each item.
Questions it answers:
- On which of the eight brand attributes do each segment’s ratings disagree most?
- How much does each sales channel’s share vary between stores in each region?
Use something else:
AGG_VEC_MEANwhen you want each item’s average rather than its spread.
Params
| Name | Type | Default | Description |
|---|---|---|---|
labels | list | — | Inline fields: one display label per member. |
expand | bool | — | One scalar column <label>[<element label>] per member instead of the array. |
element | string | — | Crosstab cell / margin only: one member by label, a scalar (its sd). |
Slot: vector or fields, no field (vector-aggregates). Default label AGG_VEC_SD_<vector>. Weight-aware: √(M2 / (N* − 1)) per member, M2 = Σw·(x − mean)², N* = Σw under kind: frequency (the expanded rows), Kish n_eff = (Σw)²/Σw² under probability.
Inputs
Members: see ## Contract; schema fields only.
Output
JSON array of numbers, one SAMPLE standard deviation per member (n − 1; AGG_STDDEV is the population form unless ddof: 1); a null member skips only that element. An element with N* ≤ 1 — one answering row, none, or all weight on one row — is NaN (null), never 0.
Reading the output
value: One standard deviation per item, in member order, each in that item’s own units: how far a typical row sits from the group’s mean on that item. 0 means every row gave the item the same value.- Caveat: It is the sample form, dividing by n - 1 (AGG_STDDEV divides by n unless its params.ddof is 1), so on a small group it reads larger than AGG_STDDEV of the same item.
- Caveat: Each item counts only the rows that answered it; compare components element_n before comparing items.
Components
labels,element_n(raw per member),element_sum,element_mean(Welford running mean),element_m2; weighted addselement_sum_weights,element_sum_weights_sq.
Contract
- Member types (
vector,fields):f32,f64,packed_bool,u16,u32,u4,u64,u8(packed_boolonly undercoerce: "binary"; avec_*field’s elements are members); any other isPULSE_VECTOR_MEMBER_TYPE. - Weight: weighted under
frequencyandprobabilityweights. - Streaming: streamable; components
mergeable. - Components:
n,n_null,labels,element_n,element_sum,element_mean,element_m2; optionalsum_weights,n_eff,n_weight_invalid,element_sum_weights,element_sum_weights_sq.
Gotchas
- The array is refused (
PROCESSING_CONFIG, reasonarray_valued) as asortkey, a window, post-test or overlay input, a crosstab cell or margin withoutelement, or a chain stage feeding another — unless expanded (vector-aggregates). - Expanded columns are ordinary nullable f64 columns; a
returnpath names one quoted,data[*]."<label>[<elem>]". elementcell: a record reaches an auxiliary margin only if its member reached a cell.
See
pulse_examples_search tags=[multivariate, streaming-friendly]- Skills:
vector-aggregates,op-agg-vec-mean,multivariate-design,op-agg-stddev