name: op-agg-ci-upper
description: Upper bound of the confidence interval for the mean.
kind: operator
category: AGG
operator: AGG_CI_UPPER
type: reference
applies_to: process, compose, predict
examples_tags: [hypothesis-test, streaming-friendly]
Use when
Upper end of a confidence interval for the mean of a numeric field, showing how precisely the average is pinned down.
Questions it answers:
- What is the highest average wait time the data are consistent with at 95% confidence?
- How wide is the uncertainty around each region’s mean score?
Use something else:
AGG_CI_LOWERwhen you want the lower end of the same interval.
Params
| Name | Type | Default | Description |
|---|---|---|---|
confidence | float | 0.95 | Confidence level in (0, 1). |
method | string | "normal" | "normal" (Welford-streamable); "bootstrap" is refused. |
Bound = mean ∓ z·√(s²/n), z = qnorm(1 − α/2). Weight (both kinds; "weight": null opts out): weighted mean, s² on w* = w·N*/Σw, stderr √(s²/N*), N* = Σw (frequency) or Kish n_eff (probability); same z. Invalid weights excluded and warned.
Inputs
field — admitted types: see ## Contract.
Output
Scalar float64 — upper CI bound. NaN when n < 2 (weighted: N* ≤ 1; null in JSON).
Reading the output
value: The upper end of a confidence interval for the group’s mean at the requested confidence (95% by default): mean + z * standard error, where the standard error is the sample standard deviation (dividing by n - 1) over sqrt(n).- Caveat: The interval is about the MEAN, not about individual rows: most rows can, and usually do, fall outside it.
- Caveat: The confidence level describes the method: over repeated samples, intervals built this way capture the true mean that share of the time. Any one interval either contains it or not.
Components
mean— Welford running meanstderr— Standard error of the meanalpha—1 - confidencet_critical— Normal critical z (qnorm(1 − α/2))upper— Resolved upper bound
Contract
- Types (
field):date,datetime,f32,f64,packed_bool,u16,u32,u4,u64,u8; any other scalar type isPULSE_FIELD_TYPE_UNSUPPORTED;decimal128isPULSE_AGG_NOT_MEANINGFUL_FOR_DECIMAL. - Weight: weighted under
frequencyandprobabilityweights. - Streaming: streamable; components
mergeable. - Components:
n,n_null,mean,stderr,alpha,t_critical,upper; optionalsum_weights,n_eff,n_weight_invalid.
Gotchas
- Normal z, not t: small samples get narrower intervals than t.
n < 2(weighted N* ≤ 1) → NaN."bootstrap"→PROCESSING_CONFIGat run time; predict passes it.
See
pulse_examples_search tags=[hypothesis-test]- Skills:
aggregation-design,statistical-testing,response-components