What does an outlier calculator do?异常值计算器有什么作用?
Place this specific workflow in context with the complete statistical outlier guide, which connects the definitions, alternatives, validation steps, and related implementation guides.
可通过完整的统计异常值指南理解本专题在整体流程中的位置;该指南串联了定义、替代方案、验证步骤与相关实施文章。
An outlier calculator applies a stated rule to one numerical dataset and returns values outside the resulting cutoff. This page supports the 1.5×IQR rule and absolute z-score thresholds; every output is a candidate for investigation, not automatic proof of error.
异常值计算器对一组数值数据应用明确规则,并返回超出所得阈值的数值。本页支持 1.5×IQR 规则和绝对 Z 分数阈值;每个输出都只是待调查候选项,并非数据错误的自动证明。
The choice of comparison group comes before the formula. Calculate store-level sales within a comparable product and season, laboratory measurements within a stable procedure, or response times within the same service regime. Mixing units, populations, time periods, or operating modes can create flags that describe the mixture rather than a genuinely unusual observation.
比较组的选择先于公式。门店销售额应在可比的产品与季节内计算,实验室测量应基于稳定流程,响应时间应处于相同服务状态。混合单位、总体、时间区间或运行模式,可能产生仅反映数据混合而非真实异常观测的标记。
Use the outlier calculator使用异常值计算器
Enter at least four finite numbers separated by commas, spaces, semicolons, or line breaks. Choose IQR for a robust, distribution-light starting point or z-score when a mean-and-standard-deviation reference is appropriate. The calculation runs in this browser; the page does not upload the values.
输入至少四个有限数值,可用逗号、空格、分号或换行分隔。若需要稳健且较少依赖分布假设的起点,选择 IQR;若均值与标准差能够代表参考分布,选择 Z 分数。计算在当前浏览器中运行,本页不会上传这些数值。
IQR quartiles use linear interpolation at index (n−1)p. Values strictly outside the fences are flagged. Z-score uses the selected sample or population standard deviation.
IQR 四分位数按索引 (n−1)p 进行线性插值;严格超出围栏的数值会被标记。Z 分数使用所选的样本或总体标准差。
Privacy and scope: calculations are local to this page, but do not paste confidential data into any tool unless your organization permits it. This calculator handles one univariate series; it does not fit a distribution, run Grubbs’ test, model time dependence, or detect multivariate anomalies.
隐私与范围:计算在本页本地完成,但除非组织政策允许,否则不要向任何工具粘贴机密数据。本计算器仅处理单变量序列;它不会拟合分布、运行 Grubbs 检验、建模时间依赖或检测多变量异常。
What to prepare before calculating outliers计算异常值前需要准备什么
Use the same variable, unit, population, and relevant operating condition. Segment known groups before applying one global cutoff.
使用相同变量、单位、总体与相关运行条件。应用全局阈值前,应先拆分已知分组。
Keep an untouched source column and identifiers so each flag can be traced back to its record, instrument, file, or event.
保留未修改的源数据列与标识符,使每个标记都能追溯到记录、仪器、文件或事件。
Decide whether blanks, nulls, sentinel codes, and infinities are errors, exclusions, or meaningful states. This calculator rejects nonnumeric tokens.
确定空白、null、哨兵编码与无穷值是错误、排除项还是有意义状态。本计算器会拒绝非数值标记。
State what a false positive or missed event would cost. A classroom exercise, fraud alert, and safety measurement need different review rules.
说明误报或漏报的代价。课堂练习、欺诈预警与安全测量需要不同的复核规则。
Do not calculate across labels that encode different processes. For example, a 500 ms response may be ordinary for a batch job and extreme for an interactive API. If time order matters, preserve timestamps and inspect the series for trends, seasonality, regime changes, and autocorrelation before using a global cutoff.
不要跨越代表不同过程的标签进行计算。例如,500 毫秒对批处理任务可能很普通,但对交互式 API 可能极端。如果时间顺序很重要,应保留时间戳,并在使用全局阈值前检查趋势、季节性、状态变化与自相关。
IQR vs z-score: which outlier method should you use?IQR 与 Z 分数:应该使用哪种异常值方法?
| Method方法 | Useful starting point when适合作为起点的情况 | Main limitation主要限制 | Key setting关键设置 |
|---|---|---|---|
| IQR fences | You have one numerical variable; the distribution is skewed, heavy-tailed, or uncertain; a robust summary is preferred.只有一个数值变量;分布偏态、重尾或不确定;希望使用稳健汇总。 | Can flag many observations in strongly skewed data and can behave oddly when IQR is zero.在强偏态数据中可能标记较多观测;IQR 为零时表现可能不理想。 | Quartile convention and multiplier, commonly 1.5 for inner fences.四分位数约定与倍数,内围栏通常使用 1.5。 |
| Z-scoreZ 分数 | Mean and standard deviation are meaningful and an approximately normal or otherwise justified reference is available.均值与标准差有意义,且存在近似正态或其他可辩护的参考分布。 | Extremes influence both mean and standard deviation; skew and mixed groups can make the cutoff misleading.极端值会影响均值与标准差;偏态与混合分组可能使阈值产生误导。 | Absolute cutoff plus sample (n−1) or population (n) standard deviation.绝对阈值以及样本(n−1)或总体(n)标准差。 |
| Formal outlier test正式异常值检验 | A statistical hypothesis, error rate, distributional assumption, and single-versus-multiple-outlier design are explicitly defined.已明确统计假设、错误率、分布假设以及单个或多个异常值的检验设计。 | A simple calculator cannot replace assumption checks, multiplicity control, or a test-specific procedure.简单计算器不能替代假设检查、多重性控制或检验专用流程。 | Test, significance level, sample size, number of suspected outliers, and assumptions.检验方法、显著性水平、样本量、疑似异常值数量与假设。 |
The NIST guidance on detecting outliers recommends graphical checks and attention to assumptions, including whether the task concerns one or multiple outliers. Use a calculator as a transparent first pass, then match the next method to the data-generating process.
NIST 异常值检测指南建议进行图形检查并关注假设,包括任务针对单个还是多个异常值。可将计算器作为透明的初步筛查,再根据数据生成过程选择后续方法。
Outlier calculator formulas and conventions异常值计算器的公式与约定
IQR method. Sort the values, calculate the first and third quartiles, and subtract Q1 from Q3. The inner fences used by many box plots are:
IQR 方法。将数值排序,计算第一与第三四分位数,再用 Q3 减去 Q1。许多箱线图使用的内围栏为:
Lower fence = Q1 − k × IQR
Upper fence = Q3 + k × IQR
This calculator defaults to k = 1.5 and flags values strictly below the lower fence or above the upper fence. NIST also describes outer fences using k = 3. The labels “mild” and “extreme” are descriptive conventions, not proof about cause or validity.
本计算器默认 k = 1.5,并标记严格低于下围栏或高于上围栏的数值。NIST 还使用 k = 3 描述外围栏。“轻度”与“极端”只是描述性约定,不能证明成因或有效性。
Z-score method. Subtract the mean from each value and divide by the chosen standard deviation:
Z 分数方法。每个数值减去均值,再除以所选标准差:
Flag when |z| > cutoff
The official SciPy z-score documentation exposes the degrees-of-freedom correction because population and sample standard deviations differ. This page makes the same choice visible: use n when the entered values are the complete population of interest; use n−1 when they are a sample used to estimate variability.
官方 SciPy Z 分数文档公开了自由度修正设置,因为总体与样本标准差不同。本页也显式提供该选择:输入值是目标总体的全部成员时使用 n;输入值是用于估计变异性的样本时使用 n−1。
Quartiles are not uniquely implemented. This page uses linear interpolation at the fractional index (n−1)p. Spreadsheet, textbook, and library conventions can produce different Q1 and Q3 values for small datasets. Record the convention and avoid presenting one calculator’s result as universally exact.
四分位数没有唯一实现。本页在分数索引 (n−1)p 处使用线性插值。电子表格、教材与程序库约定可能在小数据集中产生不同的 Q1 与 Q3。应记录所用约定,不要把某个计算器的结果表述为普遍精确值。
Worked outlier calculation example异常值计算示例
Consider this hypothetical dataset: 4, 5, 5, 6, 6, 7, 8, 30. It could represent eight observations measured in the same unit under comparable conditions; no real customer, process, or performance claim is implied.
考虑以下假设数据集:4、5、5、6、6、7、8、30。它可代表在可比条件下使用相同单位测得的八个观测;不涉及任何真实客户、流程或性能声明。
- Sort and confirm the comparison排序并确认比较范围The values are already sorted. Confirm that all eight belong to the same variable, unit, and relevant group.这些数值已经排序。确认八个观测均属于相同变量、单位与相关分组。
- Calculate quartiles计算四分位数With this page’s linear interpolation convention, Q1 = 5 and Q3 = 7.25.按本页的线性插值约定,Q1 = 5,Q3 = 7.25。
- Calculate IQR and fences计算 IQR 与围栏IQR = 2.25. The lower fence is 1.625 and the upper fence is 10.625 when k = 1.5.IQR = 2.25。k = 1.5 时,下围栏为 1.625,上围栏为 10.625。
- Flag, then investigate标记后再调查Only 30 lies outside the fences. Check its source, unit, timing, group, and effect on downstream results before deciding how to handle it.只有 30 超出围栏。决定如何处理前,应检查其来源、单位、时间、分组及对下游结果的影响。
A z-score calculation can produce a different outcome because 30 increases both the mean and standard deviation. Disagreement is not a software bug by itself; it signals that the methods encode different definitions of unusualness. Report the method-specific result rather than voting across methods without a rationale.
Z 分数计算可能产生不同结果,因为 30 同时提高均值与标准差。方法不一致本身不代表软件错误;它说明各方法对“异常”的定义不同。应报告具体方法的结果,而不是在缺乏理由时让多种方法“投票”。
How to validate outlier calculator results如何验证异常值计算器结果
- Reconcile the input核对输入Confirm row count, parsing, decimal separators, units, duplicates, missing values, and whether any sentinel codes were treated as measurements.确认行数、解析规则、小数分隔符、单位、重复项、缺失值,以及哨兵编码是否被误当成测量值。
- Visualize the full distribution可视化完整分布Use a dot plot, histogram, box plot, and—when order matters—a run chart. Look for skew, multiple groups, gaps, truncation, and regime changes.使用点图、直方图、箱线图;若顺序重要,再使用运行图。检查偏态、多分组、间隙、截断与状态变化。
- Trace each flag to evidence将每个标记追溯到证据Inspect the source record, instrument, event log, document, or transaction. Determine whether the value is an error, valid rare event, separate population, or unresolved observation.检查源记录、仪器、事件日志、文档或交易。判断数值是错误、真实罕见事件、独立总体还是尚未解决的观测。
- Run sensitivity checks进行敏感性检查Compare defensible quartile conventions, multipliers, robust summaries, group definitions, and results with and without the candidate—without silently deleting it.比较可辩护的四分位约定、倍数、稳健汇总、分组定义,以及包含与不包含候选值时的结果,但不要静默删除数据。
- Document the decision记录决策Preserve raw data, method, parameters, software convention, reviewer, evidence, action, and downstream impact. Detection and handling are separate decisions.保留原始数据、方法、参数、软件约定、复核人、证据、行动与下游影响。检测与处理是两个独立决定。
| Field字段 | What to record记录内容 | Why it matters重要原因 |
|---|---|---|
| Comparison scope比较范围 | Variable, unit, group, time window, inclusion rules变量、单位、分组、时间窗口、纳入规则 | Defines what “unusual” means定义“异常”的参照 |
| Calculation计算 | Method, quartile convention or SD type, threshold, software/version方法、四分位约定或标准差类型、阈值、软件/版本 | Makes the flag reproducible使标记可复现 |
| Evidence证据 | Source record, logs, documents, subject-matter review源记录、日志、文档、领域复核 | Separates errors from valid rare events区分错误与真实罕见事件 |
| Action and impact行动与影响 | Retain, correct, transform, segment, exclude; results before and after保留、修正、转换、分组、排除;处理前后结果 | Keeps the decision auditable使决策可审计 |
Common outlier calculator mistakes and limits异常值计算器的常见错误与限制
A valid extreme may be the most important observation. Correct or exclude only with evidence and a documented rule.
真实极端值可能是最重要的观测。只有在有证据及记录规则时才修正或排除。
One cutoff can mislabel a long tail or minority group. Segment, transform, or use a model that reflects the process.
单一阈值可能误标长尾或少数分组。应分组、转换或采用反映真实过程的模型。
Quartiles, standard deviation, equality at cutoffs, missing values, and rounding all affect reproducibility.
四分位数、标准差、阈值等号、缺失值与舍入方式都会影响可复现性。
A point may be ordinary in each variable but unusual in combination, context, or time. Use multivariate or time-series methods where needed.
某点在各变量上可能都普通,却在组合、语境或时间上异常。必要时应使用多变量或时间序列方法。
Zero IQR deserves special care. If at least half the values are identical, both quartiles may coincide and the IQR fence can collapse to one value. That can flag every small deviation even when measurement resolution or ordinary noise explains it. Show the raw data, consider domain tolerances, and use a method suited to the measurement process.
IQR 为零时需要特别谨慎。如果至少一半数值相同,两个四分位数可能重合,IQR 围栏会收缩到单一点。这可能把每个小偏差都标记出来,即使测量分辨率或普通噪声足以解释它。应展示原始数据、考虑领域容差,并使用适合测量过程的方法。
Investigate reviewed outlier flags with connected evidence结合关联证据调查已复核的异常标记
Before opening InfiniSynapse, prepare only data you are authorized to use: stable record IDs, raw values, units, group and time fields, the selected detection method and threshold, review status, and relevant source files or documents. InfiniSynapse is an AI-powered workspace for analysis across databases, files, and documents; it is not presented here as a dedicated outlier calculator or formal statistical-test package.
打开 InfiniSynapse 前,只准备你有权使用的数据:稳定记录 ID、原始值、单位、分组与时间字段、所选检测方法与阈值、复核状态,以及相关源文件或文档。InfiniSynapse 是跨数据库、文件与文档进行 AI 辅助分析的工作区;本页不会把它描述为专用异常值计算器或正式统计检验包。
Use the web app at the investigation stage to explore reviewed flags beside connected context, then independently verify consequential conclusions before operational use.
可在调查阶段使用网页应用,将已复核标记与关联语境一起探索;任何具有实际后果的结论都应在业务使用前独立验证。
Open InfiniSynapse for connected data analysis打开 InfiniSynapse 进行关联数据分析Frequently asked questions about outlier calculators关于异常值计算器的常见问题
What is the formula for calculating outliers with IQR?使用 IQR 计算异常值的公式是什么?
Calculate IQR as Q3 minus Q1. The usual inner fences are Q1 minus 1.5 times IQR and Q3 plus 1.5 times IQR. Values beyond those fences are candidate outliers to review.
IQR 等于 Q3 减去 Q1。常用内围栏为 Q1 减去 1.5 倍 IQR,以及 Q3 加上 1.5 倍 IQR。超出围栏的数值是需要复核的候选异常值。
Should an outlier calculator use IQR or z-scores?异常值计算器应使用 IQR 还是 Z 分数?
Use IQR as a robust default for one-variable data, especially when shape is skewed or uncertain. Use z-scores when mean and standard deviation are meaningful and an approximately normal reference is defensible.
可将 IQR 作为单变量数据的稳健默认方法,尤其在分布偏态或形态不确定时。若均值与标准差有意义,且近似正态参考可以辩护,则使用 Z 分数。
Why can two outlier calculators give different answers?为什么两个异常值计算器会给出不同答案?
Quartile algorithms, fence multipliers, population versus sample standard deviation, missing-value rules, and threshold comparisons can differ. Record those settings before comparing results.
四分位算法、围栏倍数、总体或样本标准差、缺失值规则与阈值比较方式都可能不同。比较结果前应记录这些设置。
Does a flagged value have to be removed?被标记的数值必须删除吗?
No. A flag is evidence for investigation, not proof of error. Check units, source records, grouping, timing, and business context before retaining, correcting, transforming, segmenting, or excluding a value.
不必。标记是调查线索,不是错误证明。决定保留、修正、转换、分组或排除前,应检查单位、源记录、分组、时间与业务语境。
Can this calculator detect multivariate or time-series anomalies?本计算器能检测多变量或时间序列异常吗?
No. This calculator evaluates one numerical series at a time. Multivariate relationships, trend, seasonality, autocorrelation, and change points require methods designed for those structures.
不能。本计算器每次只评估一个数值序列。多变量关系、趋势、季节性、自相关与变化点需要针对这些结构设计的方法。
Authoritative sources and verification notes权威来源与核验说明
Definitions, IQR fences, and review cautions were checked against the NIST/SEMATECH handbook explanation of outliers and box-plot fences and the NIST detection-of-outliers guidance. Z-score behavior and the degrees-of-freedom choice were checked against the official SciPy z-score reference.
定义、IQR 围栏与复核注意事项参考了 NIST/SEMATECH 手册对异常值与箱线图围栏的说明以及 NIST 异常值检测指南。Z 分数行为与自由度选择参考了官方 SciPy Z 分数文档。
All example values are hypothetical. Calculator output depends on the entered data and visible settings; it is not a formal hypothesis-test result, professional judgment, or instruction to delete data. Library defaults and product capabilities can change, so verify current official documentation for consequential work.
所有示例数值均为假设。计算器输出取决于输入数据与可见设置;它不是正式假设检验结果、专业判断或删除数据的指令。程序库默认值与产品能力可能变化,具有实际后果的工作应核对最新官方文档。
InfiniSynapse