本文へ移動
cccskills
無料GitHub で公開

uncertainty-propagator

当有一组带不确定度的测量量、需要给导出量一个不确定度时使用。做线性协方差传播(含相关项),给出符号灵敏度、不确定度预算、线性与蒙特卡罗的一致性检查,并按贡献大小排出下一轮该先测哪个量。灵敏度大不等于贡献大,这一条会被明确区分。

不做拟合、不诊断系统误差、不替缺失的不确定度编数。

インストール方法を見る

含まれるファイル(3)

  • SKILL.md9.4 KB
  • references/method.md3.5 KB
  • scripts/propagate_uncertainty.py24.5 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Uncertainty Propagator

Turn an explicit measurement model and an input covariance description into a traceable uncertainty result. Keep measured values, uncertainty assumptions, model assumptions, and numerical conclusions separate.

Required inputs

Collect these before calculating:

  1. Model: each output as an equation, such as g = 4*pi**2*L/T**2.
  2. Input values: central value and unit for every symbol.
  3. Uncertainty definition: standard uncertainty, expanded uncertainty plus coverage factor, confidence interval plus distribution, or raw repeats.
  4. Dependence: covariance/correlation information, or an explicit reason inputs may be treated as independent.
  5. Desired output: absolute uncertainty, relative uncertainty, covariance between outputs, or a measurement-priority recommendation.

If an uncertainty, distribution, or dependence is unknown, label it unknown; do not silently replace it with zero or independence. Ask only for missing information that can materially change the result.

Boundary

Use this skill for propagation through a stated model and for local sensitivity ranking.

  • Use model-fit-auditor when model parameters must first be estimated from data and that fit has to be judged.
  • Use dataset-systematic-error-hunter when drift, hysteresis, calibration bias, or omitted physics must be diagnosed from raw data.
  • Use physics-mechanism-decomposer when the physical model itself is still disputed.
  • Do not convert tolerance limits or instrument resolution to standard uncertainty without naming the assumed distribution.
  • Do not imply that propagation captures unknown bias or model inadequacy.

Workflow

1. Normalize uncertainty inputs

Convert every supplied uncertainty to a standard uncertainty u(x_i). Record each conversion and its assumption:

  • standard uncertainty: use directly;
  • expanded uncertainty U: use u = U/k only when k is supplied or justified;
  • rectangular half-width a: u = a/sqrt(3);
  • triangular half-width a: u = a/sqrt(6);
  • repeated observations: report the distinction between sample spread and uncertainty of the mean.

Keep units attached in the human-readable analysis. The helper script expects a coherent numerical unit system and does not perform unit conversion.

2. Build and validate covariance

For inputs x, construct covariance matrix Σ_x:

Σ_ij = ρ_ij u(x_i) u(x_j).

Check symmetry, diagonal non-negativity, correlation bounds, and positive semidefiniteness. Never include a covariance term twice in hand calculations. If independence is assumed, state why that is defensible (for example, separate instruments or independent calibration chains).

3. Compute first-order propagation

For output vector y = f(x), compute the Jacobian at the central values:

J_ki = ∂f_k/∂x_i

and propagate:

Σ_y = J Σ_x Jᵀ.

For one output, report signed sensitivity coefficients c_i = ∂f/∂x_i, diagonal variance contributions c_i²u_i², and the total correlation contribution. Do not present diagonal shares as a complete additive budget when correlations are important.

4. Check whether linearization is credible

Run Monte Carlo when the model is nonlinear, relative input uncertainties are not small, distributions are bounded/asymmetric, the result is near a singularity, or cancellation makes the linear result fragile.

Compare at least:

  • output mean versus the model evaluated at input means;
  • Monte Carlo standard deviation versus linearized standard uncertainty;
  • quantiles/skewness versus a symmetric interval;
  • rejected/invalid draws and their physical cause.

A discrepancy is evidence to investigate, not something to average away. Increase draws to test stability before attributing a mismatch to nonlinearity.

5. Diagnose conditioning and rank measurements

Use both local sensitivity and actual uncertainty contribution:

  • sensitivity coefficient: how strongly the model responds per unit change;
  • variance contribution: sensitivity combined with present measurement uncertainty;
  • elasticity (x_i/y)(∂y/∂x_i): signed, as the script reports it (for g = 4π²L/T² the elasticity of T is −2); compare magnitudes |e_i| when ranking differently scaled inputs; defined only when values are nonzero;
  • Jacobian condition number: warns that inverse interpretation or multi-output separation may be unstable; it is not by itself an uncertainty.

Recommend improving a measurement only when reducing its uncertainty would materially reduce the output uncertainty. For correlated inputs, discuss the covariance source before ranking individual measurements.

6. Report with an audit trail

Return sections in this order:

  1. Result — estimate, standard uncertainty, unit, and interval convention.
  2. Model and assumptions — equations, distributions, conversions, correlations, and omitted effects.
  3. Sensitivity budget — signed coefficients, elasticities, diagonal contributions, and correlation contribution.
  4. Method check — linear propagation versus Monte Carlo and any conditioning warning.
  5. Next measurement — highest-value measurement improvement, expected benefit, and why.
  6. Limitations — unknown bias, model inadequacy, unsupported distribution assumptions, or extrapolation.

Use appropriate significant figures: normally one or two significant digits in uncertainty, with the estimate rounded to the same decimal place. Preserve extra digits in intermediate calculations.

Helper script

scripts/propagate_uncertainty.py accepts a JSON specification and emits a JSON report. It uses SymPy for symbolic derivatives and NumPy for covariance algebra and Monte Carlo sampling.

python3 scripts/propagate_uncertainty.py example.json --samples 100000 --seed 20260904

Input shape:

{
  "variables": {
    "L": {"value": 0.994, "std_uncertainty": 0.002},
    "T": {"value": 2.006, "std_uncertainty": 0.004}
  },
  "correlations": [{"a": "L", "b": "T", "rho": 0.25}],
  "outputs": {"g": "4*pi**2*L/T**2"}
}

All numerical values must already use coherent units. Review references/method.md for interpretation and failure criteria. If dependencies or valid numerical inputs are unavailable, provide the symbolic method and mark numerical verification as blocked rather than inventing a result.

Names in outputs are plain symbols: every one must be declared under variables. The only built-in constant is pi; write exp(1) for Euler's number, so an undeclared E (energy, field, Young's modulus) is an error, not 2.718. Callable functions: sqrt, cbrt, exp, log, ln, sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh, asinh, acosh, atanh, abs, erf, erfc. Python reserved words cannot be names; call a wavelength lam, not lambda. Each variable may carry an optional unit string as a label; it is not converted. Unknown fields (for example correlation for correlations) are errors. Exit code 0 means a report was produced, 2 an input error reported as {"error": ...}; --selftest runs the script's regression cases.

Quality gate

Before finalizing, verify:

  • every symbol has a value, unit in the report, and uncertainty status;
  • uncertainty conversions and distribution assumptions are visible;
  • correlations are included or independence is justified;
  • covariance is valid and dimensions of J, Σ_x, and Σ_y agree;
  • nonlinear or fragile models receive a Monte Carlo comparison;
  • sensitivity is not confused with uncertainty contribution;
  • the recommendation names a measurable change and expected effect;
  • unknown systematic and model errors remain explicit limitations.

References

  • references/method.md — propagation formulas, Monte Carlo diagnostics, sensitivity and elasticity definitions
  • ../_shared/physics-evidence-contract.md — §4 academic-integrity boundary shared by all physics skills (no invented uncertainties or correlations)

变更记录 / Changelog

版本日期变更类型
0.1.12026-09-26脚本里表达式的名字一律按普通符号处理,未声明的 E、I、S、gamma 等不再静默取 SymPy 含义,只保留 pi 与白名单函数;变量名用 lambda 等保留字时给出改名提示;未知字段(如 correlation)改为报错;加 --selftest;弹性系数统一为带符号(与脚本输出、method.md 一致),排序按绝对值;Boundary 三处泛称改为点名 model-fit-auditor、dataset-systematic-error-hunter、physics-mechanism-decomposer;补 _shared 证据契约 §4 引用;示例命令改用 python3(macOS 自带的只有 python3)patch
0.1.02026-09-05初始版本minor

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

当学生说"Common App 活动栏写不下"、"这段活动描述超字数了"、"帮我把这几条压到限制内"时使用。先按官方申请表核对当季字符限额,再逐条检查;一次把所有条目量完并直接给出压缩版,只在需要砍掉实质内容时才用选择题问该保哪部分。每改一版都用工具重新数一遍字符,绝不凭感觉说"这样应该够了"。只压缩,不代写空白。

日本語の概要は準備中です。原文の説明を表示しています。

ChromiteCr/Skills42026年10月16日 更新

当学生说"我参加过一些活动但没整理过"、"帮我把经历录进去"、"我的活动档案是空的"时使用。让学生一口气把记得的活动说出来,直接把这段话拆成结构化的长期事项(角色、组织、起止时间、做了什么、结果、级别),说不清的字段留空标"待补"而不是编,再用一张选择题卡把级别判定与是否重复这类关键项一次问完,然后提案入库。只记录学生真正说出口的内容,级别按事实判定,绝不往高了写。

日本語の概要は準備中です。原文の説明を表示しています。

ChromiteCr/Skills42026年10月16日 更新

当学生问"招生官会怎么看我的档案"、"我的背景还差什么"、"帮我评估一下现在的申请竞争力"时使用。以顶尖大学招生官的视角通读学生的档案、长期活动与已写下的反思,不问任何前置问题直接产出一份指名道姓的坦诚点评:这份材料的亮点、招生官真实的解读方式、明显的短板与空白、以及接下来最值得做的一到两件事。只读不写,不修改学生的任何数据,也不代写任何申请材料。

日本語の概要は準備中です。原文の説明を表示しています。

ChromiteCr/Skills42026年10月16日 更新

当使用者说"帮我填词"、"按这个字数模板写歌词"、"用多Agent对抗式写词"、"这首副歌帮我想几句"时使用,前提是字数骨架和这首歌写什么都已经有了;只有主题、还没定写什么时先用 lyric-concept-builder。拿一份字数骨架和意象系统,派三个 sonnet 子代理按不同路子并行独立起草(场景派 / 口语派 / 意象派),再派一个红队子代理逐句挑毛病,主 Agent 按句裁决拼稿,最后统一辙口与意象。收敛判据卡死:字数用 lyric-doctor 的脚本对模板数、每段同辙、hook 不含陈词、主歌二对主歌一有推进。不抄现有歌词,不替使用者决定这首歌要说什么。

日本語の概要は準備中です。原文の説明を表示しています。

ChromiteCr/Skills42026年10月16日 更新

当想知道一段 AI 回答"哪些能直接用、哪些必须先验证、哪些只能当建议"时使用。按声明类型分四级——低风险草稿材料、观点与策略建议、可查证的事实声明、会改变状态的可执行指令——每级配一句默认处置动作;再按影响半径排序,给出最小的下一步检查。可执行类一律标"不能直接执行;先做代码审阅/沙箱测试/回滚准备",其中破坏性或提权的命令排在最前。教的是一套可复用的复查习惯,不是替使用者把所有内容都核实一遍:本 skill 只分级、排序、定处置,要逐条核实走 ai-output-fact-checker,整段代码要做入库体检走 ai-code-onboarding-checklist。

日本語の概要は準備中です。原文の説明を表示しています。

ChromiteCr/Skills42026年10月16日 更新

当拿到一段 AI 生成的代码,还没决定要不要信、要不要跑、要不要往上继续加东西时使用。先做一遍客观体检:行数与嵌套深度、有没有测试、有没有硬编码密钥或遗留 TODO、依赖是不是真实存在、有没有危险调用(eval/exec、shell=True、递归删除、反序列化、提权、外发网络,按正文给的 grep 模式逐类查);再给风险评级和下一步动作。老实写明它查不了算法正确性——体检通过不等于代码是对的。回答里文字、事实和代码混在一起时先用 ai-answer-triage 分级;只审相对已有代码的一份改动用 ai-diff-review-protocol。

日本語の概要は準備中です。原文の説明を表示しています。

ChromiteCr/Skills42026年10月16日 更新

ChromiteCr のスキルをすべて見る

このスキルの問題を報告する