universal-physics-tensor 9.0.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -17
- package/bin/upt.mjs +13 -1
- package/data/atlas/atlas.json +79 -68
- package/data/atlas/atlas.jsonld +1 -1
- package/data/atlas/diffusion.json +24 -23
- package/data/atlas/oscillators.json +21 -16
- package/data/atlas/waves.json +36 -31
- package/data/atlas/witness-results.json +11 -11
- package/data/bridge-catalog.json +1192 -1636
- package/data/bridge-catalog.schema.json +390 -135
- package/data/quantities.json +53 -19
- package/data/schemas/atlas-record.v0.json +184 -46
- package/data/units.json +33 -4
- package/dist/atlas/applicability.d.ts.map +1 -1
- package/dist/atlas/applicability.js +35 -18
- package/dist/atlas/applicability.js.map +1 -1
- package/dist/atlas/association.js.map +1 -1
- package/dist/atlas/benchmark/backend-shapes.d.ts.map +1 -1
- package/dist/atlas/benchmark/backend-shapes.js +5 -1
- package/dist/atlas/benchmark/backend-shapes.js.map +1 -1
- package/dist/atlas/benchmark/baselines.d.ts.map +1 -1
- package/dist/atlas/benchmark/baselines.js +8 -0
- package/dist/atlas/benchmark/baselines.js.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts +12 -3
- package/dist/atlas/benchmark/hybrid-retrieval.d.ts.map +1 -1
- package/dist/atlas/benchmark/hybrid-retrieval.js +30 -21
- package/dist/atlas/benchmark/hybrid-retrieval.js.map +1 -1
- package/dist/atlas/benchmark/leakage.js.map +1 -1
- package/dist/atlas/benchmark/loader.js +2 -2
- package/dist/atlas/benchmark/loader.js.map +1 -1
- package/dist/atlas/benchmark/run-atlas.d.ts.map +1 -1
- package/dist/atlas/benchmark/run-atlas.js +14 -2
- package/dist/atlas/benchmark/run-atlas.js.map +1 -1
- package/dist/atlas/benchmark/stats.d.ts +3 -3
- package/dist/atlas/benchmark/stats.d.ts.map +1 -1
- package/dist/atlas/benchmark/stats.js +16 -8
- package/dist/atlas/benchmark/stats.js.map +1 -1
- package/dist/atlas/benchmark/study.js.map +1 -1
- package/dist/atlas/benchmark/types.js.map +1 -1
- package/dist/atlas/bridge-record.d.ts +4 -4
- package/dist/atlas/bridge-record.d.ts.map +1 -1
- package/dist/atlas/bridge-record.js +6 -6
- package/dist/atlas/bridge-record.js.map +1 -1
- package/dist/atlas/catalog-formal-ref.d.ts +26 -3
- package/dist/atlas/catalog-formal-ref.d.ts.map +1 -1
- package/dist/atlas/catalog-formal-ref.js +52 -5
- package/dist/atlas/catalog-formal-ref.js.map +1 -1
- package/dist/atlas/chain-pipeline.d.ts +0 -11
- package/dist/atlas/chain-pipeline.d.ts.map +1 -1
- package/dist/atlas/chain-pipeline.js +12 -24
- package/dist/atlas/chain-pipeline.js.map +1 -1
- package/dist/atlas/composition-table.js.map +1 -1
- package/dist/atlas/conventions.js.map +1 -1
- package/dist/atlas/coverage.d.ts +2 -2
- package/dist/atlas/coverage.js.map +1 -1
- package/dist/atlas/derivation.js.map +1 -1
- package/dist/atlas/derive-evidence.d.ts +6 -4
- package/dist/atlas/derive-evidence.d.ts.map +1 -1
- package/dist/atlas/derive-evidence.js +7 -2
- package/dist/atlas/derive-evidence.js.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.d.ts +0 -4
- package/dist/atlas/diffusion/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges-closure.js +8 -17
- package/dist/atlas/diffusion/bridges-closure.js.map +1 -1
- package/dist/atlas/diffusion/bridges.d.ts.map +1 -1
- package/dist/atlas/diffusion/bridges.js +27 -42
- package/dist/atlas/diffusion/bridges.js.map +1 -1
- package/dist/atlas/diffusion/dimensions.d.ts +6 -14
- package/dist/atlas/diffusion/dimensions.d.ts.map +1 -1
- package/dist/atlas/diffusion/dimensions.js +8 -16
- package/dist/atlas/diffusion/dimensions.js.map +1 -1
- package/dist/atlas/diffusion/index.d.ts +1 -1
- package/dist/atlas/diffusion/index.d.ts.map +1 -1
- package/dist/atlas/diffusion/index.js.map +1 -1
- package/dist/atlas/diffusion/models.d.ts +3 -3
- package/dist/atlas/diffusion/models.d.ts.map +1 -1
- package/dist/atlas/diffusion/models.js +5 -10
- package/dist/atlas/diffusion/models.js.map +1 -1
- package/dist/atlas/diffusion/numerics.d.ts +16 -4
- package/dist/atlas/diffusion/numerics.d.ts.map +1 -1
- package/dist/atlas/diffusion/numerics.js +38 -24
- package/dist/atlas/diffusion/numerics.js.map +1 -1
- package/dist/atlas/error-algebra.d.ts +6 -0
- package/dist/atlas/error-algebra.d.ts.map +1 -1
- package/dist/atlas/error-algebra.js +26 -0
- package/dist/atlas/error-algebra.js.map +1 -1
- package/dist/atlas/export.d.ts +18 -2
- package/dist/atlas/export.d.ts.map +1 -1
- package/dist/atlas/export.js +9 -3
- package/dist/atlas/export.js.map +1 -1
- package/dist/atlas/families.d.ts +19 -2
- package/dist/atlas/families.d.ts.map +1 -1
- package/dist/atlas/families.js +26 -3
- package/dist/atlas/families.js.map +1 -1
- package/dist/atlas/family.d.ts +27 -0
- package/dist/atlas/family.d.ts.map +1 -0
- package/dist/atlas/family.js +12 -0
- package/dist/atlas/family.js.map +1 -0
- package/dist/atlas/index.d.ts +3 -2
- package/dist/atlas/index.d.ts.map +1 -1
- package/dist/atlas/index.js +2 -1
- package/dist/atlas/index.js.map +1 -1
- package/dist/atlas/link-prediction.d.ts +107 -4
- package/dist/atlas/link-prediction.d.ts.map +1 -1
- package/dist/atlas/link-prediction.js +212 -66
- package/dist/atlas/link-prediction.js.map +1 -1
- package/dist/atlas/model.js.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-coarse.js +7 -12
- package/dist/atlas/oscillators/bridges-coarse.js.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-exact.js +6 -10
- package/dist/atlas/oscillators/bridges-exact.js.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.d.ts +3 -16
- package/dist/atlas/oscillators/bridges-limits.d.ts.map +1 -1
- package/dist/atlas/oscillators/bridges-limits.js +23 -36
- package/dist/atlas/oscillators/bridges-limits.js.map +1 -1
- package/dist/atlas/oscillators/dimensions.d.ts +9 -21
- package/dist/atlas/oscillators/dimensions.d.ts.map +1 -1
- package/dist/atlas/oscillators/dimensions.js +9 -21
- package/dist/atlas/oscillators/dimensions.js.map +1 -1
- package/dist/atlas/oscillators/index.d.ts +1 -16
- package/dist/atlas/oscillators/index.d.ts.map +1 -1
- package/dist/atlas/oscillators/index.js.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.d.ts +2 -2
- package/dist/atlas/oscillators/limit-witnesses.d.ts.map +1 -1
- package/dist/atlas/oscillators/limit-witnesses.js +17 -15
- package/dist/atlas/oscillators/limit-witnesses.js.map +1 -1
- package/dist/atlas/oscillators/models.d.ts.map +1 -1
- package/dist/atlas/oscillators/models.js +2 -6
- package/dist/atlas/oscillators/models.js.map +1 -1
- package/dist/atlas/oscillators/norm-transport-witness.js.map +1 -1
- package/dist/atlas/oscillators/norm-transport.js.map +1 -1
- package/dist/atlas/oscillators/norms.js.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.d.ts +29 -6
- package/dist/atlas/oscillators/pendulum-motion.d.ts.map +1 -1
- package/dist/atlas/oscillators/pendulum-motion.js +60 -40
- package/dist/atlas/oscillators/pendulum-motion.js.map +1 -1
- package/dist/atlas/oscillators/phase-carriage.js.map +1 -1
- package/dist/atlas/oscillators/phase-translation.d.ts +0 -11
- package/dist/atlas/oscillators/phase-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/phase-translation.js +3 -4
- package/dist/atlas/oscillators/phase-translation.js.map +1 -1
- package/dist/atlas/oscillators/position-translation.d.ts +68 -7
- package/dist/atlas/oscillators/position-translation.d.ts.map +1 -1
- package/dist/atlas/oscillators/position-translation.js +123 -12
- package/dist/atlas/oscillators/position-translation.js.map +1 -1
- package/dist/atlas/oscillators/rejections.d.ts +0 -2
- package/dist/atlas/oscillators/rejections.d.ts.map +1 -1
- package/dist/atlas/oscillators/rejections.js +0 -7
- package/dist/atlas/oscillators/rejections.js.map +1 -1
- package/dist/atlas/path-bound.js.map +1 -1
- package/dist/atlas/physjs-entries.generated.d.ts +25 -24
- package/dist/atlas/physjs-entries.generated.d.ts.map +1 -1
- package/dist/atlas/physjs-entries.generated.js +25 -24
- package/dist/atlas/physjs-entries.generated.js.map +1 -1
- package/dist/atlas/physjs-ref.d.ts +107 -70
- package/dist/atlas/physjs-ref.d.ts.map +1 -1
- package/dist/atlas/physjs-ref.js +184 -101
- package/dist/atlas/physjs-ref.js.map +1 -1
- package/dist/atlas/physjs-reviewed.d.ts +31 -0
- package/dist/atlas/physjs-reviewed.d.ts.map +1 -0
- package/dist/atlas/physjs-reviewed.js +194 -0
- package/dist/atlas/physjs-reviewed.js.map +1 -0
- package/dist/atlas/poster/associations.js.map +1 -1
- package/dist/atlas/poster/derivations.js.map +1 -1
- package/dist/atlas/poster/statements.d.ts +0 -19
- package/dist/atlas/poster/statements.d.ts.map +1 -1
- package/dist/atlas/poster/statements.js +1 -1
- package/dist/atlas/poster/statements.js.map +1 -1
- package/dist/atlas/proof-target.d.ts +1 -1
- package/dist/atlas/proof-target.js +1 -1
- package/dist/atlas/proof-target.js.map +1 -1
- package/dist/atlas/public.d.ts +2 -1
- package/dist/atlas/public.d.ts.map +1 -1
- package/dist/atlas/public.js +2 -1
- package/dist/atlas/public.js.map +1 -1
- package/dist/atlas/regime.d.ts +1 -1
- package/dist/atlas/regime.d.ts.map +1 -1
- package/dist/atlas/regime.js +1 -1
- package/dist/atlas/regime.js.map +1 -1
- package/dist/atlas/serialize.d.ts +18 -12
- package/dist/atlas/serialize.d.ts.map +1 -1
- package/dist/atlas/serialize.js +28 -18
- package/dist/atlas/serialize.js.map +1 -1
- package/dist/atlas/statement.js.map +1 -1
- package/dist/atlas/text-overlap.d.ts +23 -0
- package/dist/atlas/text-overlap.d.ts.map +1 -0
- package/dist/atlas/text-overlap.js +41 -0
- package/dist/atlas/text-overlap.js.map +1 -0
- package/dist/atlas/translation-registry.js.map +1 -1
- package/dist/atlas/translation.js.map +1 -1
- package/dist/atlas/types.d.ts +9 -2
- package/dist/atlas/types.d.ts.map +1 -1
- package/dist/atlas/types.js +1 -1
- package/dist/atlas/types.js.map +1 -1
- package/dist/atlas/waves/bridges-closure.d.ts.map +1 -1
- package/dist/atlas/waves/bridges-closure.js +2 -9
- package/dist/atlas/waves/bridges-closure.js.map +1 -1
- package/dist/atlas/waves/bridges.d.ts.map +1 -1
- package/dist/atlas/waves/bridges.js +32 -52
- package/dist/atlas/waves/bridges.js.map +1 -1
- package/dist/atlas/waves/index.d.ts +1 -1
- package/dist/atlas/waves/index.d.ts.map +1 -1
- package/dist/atlas/waves/index.js.map +1 -1
- package/dist/atlas/waves/models.d.ts +5 -6
- package/dist/atlas/waves/models.d.ts.map +1 -1
- package/dist/atlas/waves/models.js +7 -13
- package/dist/atlas/waves/models.js.map +1 -1
- package/dist/atlas/waves/numerics.d.ts.map +1 -1
- package/dist/atlas/waves/numerics.js +10 -3
- package/dist/atlas/waves/numerics.js.map +1 -1
- package/dist/atlas/witness-artifact.js.map +1 -1
- package/dist/atlas/witness-dominance.d.ts +4 -3
- package/dist/atlas/witness-dominance.d.ts.map +1 -1
- package/dist/atlas/witness-dominance.js +15 -5
- package/dist/atlas/witness-dominance.js.map +1 -1
- package/dist/atlas/witness-numeric.d.ts +38 -4
- package/dist/atlas/witness-numeric.d.ts.map +1 -1
- package/dist/atlas/witness-numeric.js +80 -2
- package/dist/atlas/witness-numeric.js.map +1 -1
- package/dist/atlas/witness-result.d.ts +7 -1
- package/dist/atlas/witness-result.d.ts.map +1 -1
- package/dist/atlas/witness-result.js.map +1 -1
- package/dist/atlas/witness-specs.d.ts.map +1 -1
- package/dist/atlas/witness-specs.js +19 -0
- package/dist/atlas/witness-specs.js.map +1 -1
- package/dist/atlas/witness-symbolic.d.ts +75 -3
- package/dist/atlas/witness-symbolic.d.ts.map +1 -1
- package/dist/atlas/witness-symbolic.js +116 -10
- package/dist/atlas/witness-symbolic.js.map +1 -1
- package/dist/atlas/witnesses/quantum-support.js.map +1 -1
- package/dist/bridges/caller-table.d.ts +1 -1
- package/dist/bridges/caller-table.d.ts.map +1 -1
- package/dist/bridges/caller-table.js.map +1 -1
- package/dist/bridges/carrier-sign.d.ts.map +1 -1
- package/dist/bridges/carrier-sign.js +8 -3
- package/dist/bridges/carrier-sign.js.map +1 -1
- package/dist/bridges/catalog-adapter.d.ts +12 -3
- package/dist/bridges/catalog-adapter.d.ts.map +1 -1
- package/dist/bridges/catalog-adapter.js +17 -9
- package/dist/bridges/catalog-adapter.js.map +1 -1
- package/dist/bridges/catalog-load.d.ts +12 -2
- package/dist/bridges/catalog-load.d.ts.map +1 -1
- package/dist/bridges/catalog-load.js +181 -13
- package/dist/bridges/catalog-load.js.map +1 -1
- package/dist/bridges/catalog-types.d.ts +74 -26
- package/dist/bridges/catalog-types.d.ts.map +1 -1
- package/dist/bridges/catalog-types.js +11 -1
- package/dist/bridges/catalog-types.js.map +1 -1
- package/dist/bridges/coefficient-statement.js +1 -5
- package/dist/bridges/coefficient-statement.js.map +1 -1
- package/dist/bridges/confrontation-coverage.js.map +1 -1
- package/dist/bridges/confrontations.d.ts +1 -1
- package/dist/bridges/confrontations.d.ts.map +1 -1
- package/dist/bridges/confrontations.js +1 -1
- package/dist/bridges/confrontations.js.map +1 -1
- package/dist/bridges/evaluation-errors.d.ts +46 -3
- package/dist/bridges/evaluation-errors.d.ts.map +1 -1
- package/dist/bridges/evaluation-errors.js +40 -4
- package/dist/bridges/evaluation-errors.js.map +1 -1
- package/dist/bridges/evaluator-inputs.d.ts.map +1 -1
- package/dist/bridges/evaluator-inputs.js +7 -5
- package/dist/bridges/evaluator-inputs.js.map +1 -1
- package/dist/bridges/evaluators.d.ts +17 -2
- package/dist/bridges/evaluators.d.ts.map +1 -1
- package/dist/bridges/evaluators.js +76 -28
- package/dist/bridges/evaluators.js.map +1 -1
- package/dist/bridges/expr-parse.d.ts +38 -4
- package/dist/bridges/expr-parse.d.ts.map +1 -1
- package/dist/bridges/expr-parse.js +101 -12
- package/dist/bridges/expr-parse.js.map +1 -1
- package/dist/bridges/holds.d.ts +40 -4
- package/dist/bridges/holds.d.ts.map +1 -1
- package/dist/bridges/holds.js +128 -19
- package/dist/bridges/holds.js.map +1 -1
- package/dist/bridges/index.d.ts +15 -14
- package/dist/bridges/index.d.ts.map +1 -1
- package/dist/bridges/index.js +14 -15
- package/dist/bridges/index.js.map +1 -1
- package/dist/bridges/input-contract.js.map +1 -1
- package/dist/bridges/membership.d.ts +5 -3
- package/dist/bridges/membership.d.ts.map +1 -1
- package/dist/bridges/membership.js +5 -6
- package/dist/bridges/membership.js.map +1 -1
- package/dist/bridges/notices.d.ts.map +1 -1
- package/dist/bridges/notices.js +5 -5
- package/dist/bridges/notices.js.map +1 -1
- package/dist/bridges/observations/types.js.map +1 -1
- package/dist/bridges/rejected.d.ts +11 -17
- package/dist/bridges/rejected.d.ts.map +1 -1
- package/dist/bridges/rejected.js +13 -68
- package/dist/bridges/rejected.js.map +1 -1
- package/dist/bridges/relation-eval.d.ts +6 -7
- package/dist/bridges/relation-eval.d.ts.map +1 -1
- package/dist/bridges/relation-eval.js +20 -50
- package/dist/bridges/relation-eval.js.map +1 -1
- package/dist/bridges/rhs-registry.js.map +1 -1
- package/dist/bridges/sensitivity.d.ts +11 -3
- package/dist/bridges/sensitivity.d.ts.map +1 -1
- package/dist/bridges/sensitivity.js +27 -13
- package/dist/bridges/sensitivity.js.map +1 -1
- package/dist/bridges/tensor-index.js.map +1 -1
- package/dist/bridges/types.d.ts +1 -7
- package/dist/bridges/types.d.ts.map +1 -1
- package/dist/bridges/types.js +1 -4
- package/dist/bridges/types.js.map +1 -1
- package/dist/bridges/validity.d.ts +33 -0
- package/dist/bridges/validity.d.ts.map +1 -0
- package/dist/bridges/validity.js +67 -0
- package/dist/bridges/validity.js.map +1 -0
- package/dist/canonical/canonical-equation.js.map +1 -1
- package/dist/canonical/dimensional-fields.js.map +1 -1
- package/dist/canonical/entries/_l1-build.js.map +1 -1
- package/dist/canonical/entries/atomic.js +1 -3
- package/dist/canonical/entries/atomic.js.map +1 -1
- package/dist/canonical/entries/condensed-matter.d.ts.map +1 -1
- package/dist/canonical/entries/condensed-matter.js +8 -9
- package/dist/canonical/entries/condensed-matter.js.map +1 -1
- package/dist/canonical/entries/dimensional-classics.d.ts.map +1 -1
- package/dist/canonical/entries/dimensional-classics.js +5 -6
- package/dist/canonical/entries/dimensional-classics.js.map +1 -1
- package/dist/canonical/entries/electromagnetism.d.ts.map +1 -1
- package/dist/canonical/entries/electromagnetism.js +6 -12
- package/dist/canonical/entries/electromagnetism.js.map +1 -1
- package/dist/canonical/entries/fluids-waves.d.ts.map +1 -1
- package/dist/canonical/entries/fluids-waves.js +3 -7
- package/dist/canonical/entries/fluids-waves.js.map +1 -1
- package/dist/canonical/entries/mechanics.d.ts.map +1 -1
- package/dist/canonical/entries/mechanics.js +4 -6
- package/dist/canonical/entries/mechanics.js.map +1 -1
- package/dist/canonical/entries/nonmonomial.d.ts.map +1 -1
- package/dist/canonical/entries/nonmonomial.js +38 -39
- package/dist/canonical/entries/nonmonomial.js.map +1 -1
- package/dist/canonical/entries/relativity.d.ts.map +1 -1
- package/dist/canonical/entries/relativity.js +6 -6
- package/dist/canonical/entries/relativity.js.map +1 -1
- package/dist/canonical/entries/statistical-mechanics.js +5 -5
- package/dist/canonical/entries/statistical-mechanics.js.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.d.ts.map +1 -1
- package/dist/canonical/entries/thermo-nuclear-cosmo.js +6 -10
- package/dist/canonical/entries/thermo-nuclear-cosmo.js.map +1 -1
- package/dist/canonical/fixed-points.d.ts +94 -0
- package/dist/canonical/fixed-points.d.ts.map +1 -0
- package/dist/canonical/fixed-points.js +81 -0
- package/dist/canonical/fixed-points.js.map +1 -0
- package/dist/canonical/linkage.d.ts +29 -4
- package/dist/canonical/linkage.d.ts.map +1 -1
- package/dist/canonical/linkage.js +47 -64
- package/dist/canonical/linkage.js.map +1 -1
- package/dist/canonical/normal-form.d.ts +0 -8
- package/dist/canonical/normal-form.d.ts.map +1 -1
- package/dist/canonical/normal-form.js +22 -23
- package/dist/canonical/normal-form.js.map +1 -1
- package/dist/canonical/registry.js.map +1 -1
- package/dist/canonical/residual.js.map +1 -1
- package/dist/canonical/seed-l-layer.d.ts +7 -1
- package/dist/canonical/seed-l-layer.d.ts.map +1 -1
- package/dist/canonical/seed-l-layer.js +7 -1
- package/dist/canonical/seed-l-layer.js.map +1 -1
- package/dist/canonical/structural.d.ts +42 -21
- package/dist/canonical/structural.d.ts.map +1 -1
- package/dist/canonical/structural.js +64 -23
- package/dist/canonical/structural.js.map +1 -1
- package/dist/cases/brownian-sphere.d.ts +3 -3
- package/dist/cases/brownian-sphere.d.ts.map +1 -1
- package/dist/cases/brownian-sphere.js +10 -9
- package/dist/cases/brownian-sphere.js.map +1 -1
- package/dist/cases/damped-resonator.d.ts.map +1 -1
- package/dist/cases/damped-resonator.js +8 -11
- package/dist/cases/damped-resonator.js.map +1 -1
- package/dist/cases/index.js.map +1 -1
- package/dist/cases/kepler-rv.d.ts +1 -1
- package/dist/cases/kepler-rv.d.ts.map +1 -1
- package/dist/cases/kepler-rv.js +3 -2
- package/dist/cases/kepler-rv.js.map +1 -1
- package/dist/cases/lumped-cooling.d.ts +8 -3
- package/dist/cases/lumped-cooling.d.ts.map +1 -1
- package/dist/cases/lumped-cooling.js +22 -24
- package/dist/cases/lumped-cooling.js.map +1 -1
- package/dist/cases/quadrature.d.ts +7 -9
- package/dist/cases/quadrature.d.ts.map +1 -1
- package/dist/cases/quadrature.js +28 -32
- package/dist/cases/quadrature.js.map +1 -1
- package/dist/cases/resistor-noise.js +7 -7
- package/dist/cases/resistor-noise.js.map +1 -1
- package/dist/cases/skin-depth.d.ts +0 -4
- package/dist/cases/skin-depth.d.ts.map +1 -1
- package/dist/cases/skin-depth.js +3 -7
- package/dist/cases/skin-depth.js.map +1 -1
- package/dist/cases/types.js.map +1 -1
- package/dist/cli/args.d.ts +30 -3
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +47 -9
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/bindings.d.ts +13 -0
- package/dist/cli/bindings.d.ts.map +1 -0
- package/dist/cli/bindings.js +33 -0
- package/dist/cli/bindings.js.map +1 -0
- package/dist/cli/closed-form-range.js.map +1 -1
- package/dist/cli/command.d.ts +8 -1
- package/dist/cli/command.d.ts.map +1 -1
- package/dist/cli/command.js.map +1 -1
- package/dist/cli/commands/_atlas-map.d.ts +2 -11
- package/dist/cli/commands/_atlas-map.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-map.js +50 -35
- package/dist/cli/commands/_atlas-map.js.map +1 -1
- package/dist/cli/commands/_atlas-route.d.ts.map +1 -1
- package/dist/cli/commands/_atlas-route.js +6 -2
- package/dist/cli/commands/_atlas-route.js.map +1 -1
- package/dist/cli/commands/_discovery-opts.d.ts.map +1 -1
- package/dist/cli/commands/_discovery-opts.js +48 -14
- package/dist/cli/commands/_discovery-opts.js.map +1 -1
- package/dist/cli/commands/atlas.d.ts.map +1 -1
- package/dist/cli/commands/atlas.js +9 -8
- package/dist/cli/commands/atlas.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +20 -20
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/axes.d.ts.map +1 -1
- package/dist/cli/commands/axes.js +20 -1
- package/dist/cli/commands/axes.js.map +1 -1
- package/dist/cli/commands/candidates.d.ts.map +1 -1
- package/dist/cli/commands/candidates.js +16 -8
- package/dist/cli/commands/candidates.js.map +1 -1
- package/dist/cli/commands/canonical.js.map +1 -1
- package/dist/cli/commands/chain.js +1 -1
- package/dist/cli/commands/chain.js.map +1 -1
- package/dist/cli/commands/confront.d.ts.map +1 -1
- package/dist/cli/commands/confront.js +22 -20
- package/dist/cli/commands/confront.js.map +1 -1
- package/dist/cli/commands/connectors.js.map +1 -1
- package/dist/cli/commands/coverage.js.map +1 -1
- package/dist/cli/commands/derive.d.ts.map +1 -1
- package/dist/cli/commands/derive.js +60 -35
- package/dist/cli/commands/derive.js.map +1 -1
- package/dist/cli/commands/discover.d.ts.map +1 -1
- package/dist/cli/commands/discover.js +20 -10
- package/dist/cli/commands/discover.js.map +1 -1
- package/dist/cli/commands/eval.d.ts.map +1 -1
- package/dist/cli/commands/eval.js +14 -10
- package/dist/cli/commands/eval.js.map +1 -1
- package/dist/cli/commands/evaluate.d.ts.map +1 -1
- package/dist/cli/commands/evaluate.js +108 -58
- package/dist/cli/commands/evaluate.js.map +1 -1
- package/dist/cli/commands/explain.d.ts.map +1 -1
- package/dist/cli/commands/explain.js +16 -8
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/frontier.js.map +1 -1
- package/dist/cli/commands/ground.d.ts.map +1 -1
- package/dist/cli/commands/ground.js +41 -10
- package/dist/cli/commands/ground.js.map +1 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/map.d.ts.map +1 -1
- package/dist/cli/commands/map.js +155 -92
- package/dist/cli/commands/map.js.map +1 -1
- package/dist/cli/commands/metric.d.ts.map +1 -1
- package/dist/cli/commands/metric.js +58 -20
- package/dist/cli/commands/metric.js.map +1 -1
- package/dist/cli/commands/path.d.ts +10 -0
- package/dist/cli/commands/path.d.ts.map +1 -1
- package/dist/cli/commands/path.js +29 -7
- package/dist/cli/commands/path.js.map +1 -1
- package/dist/cli/commands/predict.js.map +1 -1
- package/dist/cli/commands/priority.js.map +1 -1
- package/dist/cli/commands/probe.d.ts.map +1 -1
- package/dist/cli/commands/probe.js +105 -38
- package/dist/cli/commands/probe.js.map +1 -1
- package/dist/cli/commands/recover.js +1 -1
- package/dist/cli/commands/recover.js.map +1 -1
- package/dist/cli/commands/regime.d.ts +5 -4
- package/dist/cli/commands/regime.d.ts.map +1 -1
- package/dist/cli/commands/regime.js +25 -26
- package/dist/cli/commands/regime.js.map +1 -1
- package/dist/cli/commands/retrieve.d.ts.map +1 -1
- package/dist/cli/commands/retrieve.js +23 -14
- package/dist/cli/commands/retrieve.js.map +1 -1
- package/dist/cli/commands/search.d.ts.map +1 -1
- package/dist/cli/commands/search.js +9 -4
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/symbolic.js +31 -36
- package/dist/cli/commands/symbolic.js.map +1 -1
- package/dist/cli/commands/testplan.d.ts.map +1 -1
- package/dist/cli/commands/testplan.js +5 -3
- package/dist/cli/commands/testplan.js.map +1 -1
- package/dist/cli/conventions.js.map +1 -1
- package/dist/cli/determination.js.map +1 -1
- package/dist/cli/errors.js.map +1 -1
- package/dist/cli/euler-guard.js.map +1 -1
- package/dist/cli/eval-numbers.js.map +1 -1
- package/dist/cli/expr-print.d.ts +28 -3
- package/dist/cli/expr-print.d.ts.map +1 -1
- package/dist/cli/expr-print.js +42 -22
- package/dist/cli/expr-print.js.map +1 -1
- package/dist/cli/flag-help.js.map +1 -1
- package/dist/cli/graphs.js.map +1 -1
- package/dist/cli/library-defaults.d.ts +19 -0
- package/dist/cli/library-defaults.d.ts.map +1 -0
- package/dist/cli/library-defaults.js +22 -0
- package/dist/cli/library-defaults.js.map +1 -0
- package/dist/cli/main.d.ts +7 -0
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +25 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/map-evidence.js.map +1 -1
- package/dist/cli/numeric-flag.d.ts +12 -0
- package/dist/cli/numeric-flag.d.ts.map +1 -0
- package/dist/cli/numeric-flag.js +44 -0
- package/dist/cli/numeric-flag.js.map +1 -0
- package/dist/cli/output.d.ts +23 -6
- package/dist/cli/output.d.ts.map +1 -1
- package/dist/cli/output.js +15 -0
- package/dist/cli/output.js.map +1 -1
- package/dist/cli/published-url.js.map +1 -1
- package/dist/cli/record-reach.d.ts +6 -0
- package/dist/cli/record-reach.d.ts.map +1 -1
- package/dist/cli/record-reach.js +17 -11
- package/dist/cli/record-reach.js.map +1 -1
- package/dist/cli/record-tables.d.ts.map +1 -1
- package/dist/cli/record-tables.js +7 -6
- package/dist/cli/record-tables.js.map +1 -1
- package/dist/cli/record.d.ts +1 -5
- package/dist/cli/record.d.ts.map +1 -1
- package/dist/cli/record.js +40 -20
- package/dist/cli/record.js.map +1 -1
- package/dist/cli/search-index.d.ts +5 -0
- package/dist/cli/search-index.d.ts.map +1 -1
- package/dist/cli/search-index.js +19 -7
- package/dist/cli/search-index.js.map +1 -1
- package/dist/cli/statuses.d.ts +0 -2
- package/dist/cli/statuses.d.ts.map +1 -1
- package/dist/cli/statuses.js +0 -7
- package/dist/cli/statuses.js.map +1 -1
- package/dist/cli/stored-results.d.ts +7 -0
- package/dist/cli/stored-results.d.ts.map +1 -0
- package/dist/cli/stored-results.js +23 -0
- package/dist/cli/stored-results.js.map +1 -0
- package/dist/cli/top-level-help.js.map +1 -1
- package/dist/cli/version.d.ts.map +1 -1
- package/dist/cli/version.js +7 -5
- package/dist/cli/version.js.map +1 -1
- package/dist/cli-api.d.ts +49 -14
- package/dist/cli-api.d.ts.map +1 -1
- package/dist/cli-api.js +42 -17
- package/dist/cli-api.js.map +1 -1
- package/dist/composition/adjudication.js.map +1 -1
- package/dist/composition/algebraic-equivalence.d.ts +43 -0
- package/dist/composition/algebraic-equivalence.d.ts.map +1 -0
- package/dist/composition/algebraic-equivalence.js +115 -0
- package/dist/composition/algebraic-equivalence.js.map +1 -0
- package/dist/composition/aliases.js.map +1 -1
- package/dist/composition/audit-coverage.d.ts +2 -0
- package/dist/composition/audit-coverage.d.ts.map +1 -1
- package/dist/composition/audit-coverage.js.map +1 -1
- package/dist/composition/axes.d.ts +6 -0
- package/dist/composition/axes.d.ts.map +1 -1
- package/dist/composition/axes.js +18 -6
- package/dist/composition/axes.js.map +1 -1
- package/dist/composition/axis-audit.d.ts +47 -20
- package/dist/composition/axis-audit.d.ts.map +1 -1
- package/dist/composition/axis-audit.js +82 -9
- package/dist/composition/axis-audit.js.map +1 -1
- package/dist/composition/bridge-analysis.d.ts +14 -15
- package/dist/composition/bridge-analysis.d.ts.map +1 -1
- package/dist/composition/bridge-analysis.js +148 -91
- package/dist/composition/bridge-analysis.js.map +1 -1
- package/dist/composition/bridge-prediction.d.ts +5 -1
- package/dist/composition/bridge-prediction.d.ts.map +1 -1
- package/dist/composition/bridge-prediction.js +12 -16
- package/dist/composition/bridge-prediction.js.map +1 -1
- package/dist/composition/buckingham-filter.js.map +1 -1
- package/dist/composition/canonical-compare.d.ts +40 -0
- package/dist/composition/canonical-compare.d.ts.map +1 -1
- package/dist/composition/canonical-compare.js +134 -26
- package/dist/composition/canonical-compare.js.map +1 -1
- package/dist/composition/canonical-graph.d.ts +9 -10
- package/dist/composition/canonical-graph.d.ts.map +1 -1
- package/dist/composition/canonical-graph.js +33 -102
- package/dist/composition/canonical-graph.js.map +1 -1
- package/dist/composition/canonical-json.js +2 -2
- package/dist/composition/canonical-json.js.map +1 -1
- package/dist/composition/canonical-prefactors.js.map +1 -1
- package/dist/composition/catalog-graph.d.ts.map +1 -1
- package/dist/composition/catalog-graph.js +8 -25
- package/dist/composition/catalog-graph.js.map +1 -1
- package/dist/composition/chain-candidate.d.ts +10 -0
- package/dist/composition/chain-candidate.d.ts.map +1 -1
- package/dist/composition/chain-candidate.js +11 -2
- package/dist/composition/chain-candidate.js.map +1 -1
- package/dist/composition/chain-match.d.ts +6 -3
- package/dist/composition/chain-match.d.ts.map +1 -1
- package/dist/composition/chain-match.js +4 -1
- package/dist/composition/chain-match.js.map +1 -1
- package/dist/composition/chain-regime.js.map +1 -1
- package/dist/composition/chain-result.d.ts.map +1 -1
- package/dist/composition/chain-result.js +2 -14
- package/dist/composition/chain-result.js.map +1 -1
- package/dist/composition/compose-surface.js.map +1 -1
- package/dist/composition/compose-symbolic.d.ts.map +1 -1
- package/dist/composition/compose-symbolic.js +3 -2
- package/dist/composition/compose-symbolic.js.map +1 -1
- package/dist/composition/compose.d.ts.map +1 -1
- package/dist/composition/compose.js +166 -41
- package/dist/composition/compose.js.map +1 -1
- package/dist/composition/composition-recovery.d.ts.map +1 -1
- package/dist/composition/composition-recovery.js +4 -7
- package/dist/composition/composition-recovery.js.map +1 -1
- package/dist/composition/consequence.d.ts.map +1 -1
- package/dist/composition/consequence.js +15 -6
- package/dist/composition/consequence.js.map +1 -1
- package/dist/composition/consistency.js.map +1 -1
- package/dist/composition/descriptor.d.ts +1 -1
- package/dist/composition/descriptor.d.ts.map +1 -1
- package/dist/composition/descriptor.js.map +1 -1
- package/dist/composition/dimension-adjacency.js.map +1 -1
- package/dist/composition/discovery.d.ts +77 -11
- package/dist/composition/discovery.d.ts.map +1 -1
- package/dist/composition/discovery.js +194 -80
- package/dist/composition/discovery.js.map +1 -1
- package/dist/composition/edge.d.ts +40 -10
- package/dist/composition/edge.d.ts.map +1 -1
- package/dist/composition/edge.js +47 -12
- package/dist/composition/edge.js.map +1 -1
- package/dist/composition/enumerate.d.ts +2 -2
- package/dist/composition/enumerate.d.ts.map +1 -1
- package/dist/composition/enumerate.js +18 -3
- package/dist/composition/enumerate.js.map +1 -1
- package/dist/composition/evaluate-relation.d.ts +35 -11
- package/dist/composition/evaluate-relation.d.ts.map +1 -1
- package/dist/composition/evaluate-relation.js +60 -39
- package/dist/composition/evaluate-relation.js.map +1 -1
- package/dist/composition/explain.d.ts +5 -9
- package/dist/composition/explain.d.ts.map +1 -1
- package/dist/composition/explain.js +38 -18
- package/dist/composition/explain.js.map +1 -1
- package/dist/composition/expr-eval.d.ts.map +1 -1
- package/dist/composition/expr-eval.js +2 -11
- package/dist/composition/expr-eval.js.map +1 -1
- package/dist/composition/expr-simplify.d.ts +16 -0
- package/dist/composition/expr-simplify.d.ts.map +1 -1
- package/dist/composition/expr-simplify.js +24 -59
- package/dist/composition/expr-simplify.js.map +1 -1
- package/dist/composition/expr-subst.js.map +1 -1
- package/dist/composition/formula-shape.d.ts +28 -0
- package/dist/composition/formula-shape.d.ts.map +1 -1
- package/dist/composition/formula-shape.js +96 -2
- package/dist/composition/formula-shape.js.map +1 -1
- package/dist/composition/frontier-account.d.ts +3 -2
- package/dist/composition/frontier-account.d.ts.map +1 -1
- package/dist/composition/frontier-account.js +7 -3
- package/dist/composition/frontier-account.js.map +1 -1
- package/dist/composition/graph-structure.d.ts +98 -0
- package/dist/composition/graph-structure.d.ts.map +1 -0
- package/dist/composition/graph-structure.js +167 -0
- package/dist/composition/graph-structure.js.map +1 -0
- package/dist/composition/graph-viz-svg.d.ts.map +1 -1
- package/dist/composition/graph-viz-svg.js +1 -1
- package/dist/composition/graph-viz-svg.js.map +1 -1
- package/dist/composition/graph-viz.d.ts.map +1 -1
- package/dist/composition/graph-viz.js +8 -37
- package/dist/composition/graph-viz.js.map +1 -1
- package/dist/composition/grounding.js.map +1 -1
- package/dist/composition/identifiability.d.ts +91 -4
- package/dist/composition/identifiability.d.ts.map +1 -1
- package/dist/composition/identifiability.js +363 -6
- package/dist/composition/identifiability.js.map +1 -1
- package/dist/composition/index.d.ts +14 -8
- package/dist/composition/index.d.ts.map +1 -1
- package/dist/composition/index.js +7 -5
- package/dist/composition/index.js.map +1 -1
- package/dist/composition/mathts-quiet.d.ts +29 -0
- package/dist/composition/mathts-quiet.d.ts.map +1 -0
- package/dist/composition/mathts-quiet.js +57 -0
- package/dist/composition/mathts-quiet.js.map +1 -0
- package/dist/composition/mathts-scalar-symbols.d.ts.map +1 -1
- package/dist/composition/mathts-scalar-symbols.js +20 -35
- package/dist/composition/mathts-scalar-symbols.js.map +1 -1
- package/dist/composition/not-composable-seeds.d.ts +3 -1
- package/dist/composition/not-composable-seeds.d.ts.map +1 -1
- package/dist/composition/not-composable-seeds.js +2 -0
- package/dist/composition/not-composable-seeds.js.map +1 -1
- package/dist/composition/probe/backend-protocol.js.map +1 -1
- package/dist/composition/probe/candidate-store.js.map +1 -1
- package/dist/composition/probe/corpus.d.ts +4 -2
- package/dist/composition/probe/corpus.d.ts.map +1 -1
- package/dist/composition/probe/corpus.js +20 -9
- package/dist/composition/probe/corpus.js.map +1 -1
- package/dist/composition/probe/dataset.d.ts +17 -0
- package/dist/composition/probe/dataset.d.ts.map +1 -1
- package/dist/composition/probe/dataset.js +95 -50
- package/dist/composition/probe/dataset.js.map +1 -1
- package/dist/composition/probe/experiment-design.d.ts +5 -1
- package/dist/composition/probe/experiment-design.d.ts.map +1 -1
- package/dist/composition/probe/experiment-design.js +44 -24
- package/dist/composition/probe/experiment-design.js.map +1 -1
- package/dist/composition/probe/expression-gaps.js.map +1 -1
- package/dist/composition/probe/falsify.d.ts +14 -3
- package/dist/composition/probe/falsify.d.ts.map +1 -1
- package/dist/composition/probe/falsify.js +16 -27
- package/dist/composition/probe/falsify.js.map +1 -1
- package/dist/composition/probe/fingerprint.js.map +1 -1
- package/dist/composition/probe/fit.d.ts +7 -1
- package/dist/composition/probe/fit.d.ts.map +1 -1
- package/dist/composition/probe/fit.js +48 -23
- package/dist/composition/probe/fit.js.map +1 -1
- package/dist/composition/probe/frontier.d.ts.map +1 -1
- package/dist/composition/probe/frontier.js +33 -15
- package/dist/composition/probe/frontier.js.map +1 -1
- package/dist/composition/probe/generator.d.ts +27 -1
- package/dist/composition/probe/generator.d.ts.map +1 -1
- package/dist/composition/probe/generator.js +53 -30
- package/dist/composition/probe/generator.js.map +1 -1
- package/dist/composition/probe/index.d.ts +18 -2
- package/dist/composition/probe/index.d.ts.map +1 -1
- package/dist/composition/probe/index.js +10 -2
- package/dist/composition/probe/index.js.map +1 -1
- package/dist/composition/probe/limits.d.ts +24 -1
- package/dist/composition/probe/limits.d.ts.map +1 -1
- package/dist/composition/probe/limits.js +53 -11
- package/dist/composition/probe/limits.js.map +1 -1
- package/dist/composition/probe/metadata.js.map +1 -1
- package/dist/composition/probe/pipeline.d.ts +5 -0
- package/dist/composition/probe/pipeline.d.ts.map +1 -1
- package/dist/composition/probe/pipeline.js +22 -9
- package/dist/composition/probe/pipeline.js.map +1 -1
- package/dist/composition/probe/power-law.d.ts +121 -0
- package/dist/composition/probe/power-law.d.ts.map +1 -0
- package/dist/composition/probe/power-law.js +255 -0
- package/dist/composition/probe/power-law.js.map +1 -0
- package/dist/composition/probe/problem.d.ts +12 -1
- package/dist/composition/probe/problem.d.ts.map +1 -1
- package/dist/composition/probe/problem.js +242 -48
- package/dist/composition/probe/problem.js.map +1 -1
- package/dist/composition/probe/report.js +1 -1
- package/dist/composition/probe/report.js.map +1 -1
- package/dist/composition/probe/residual.d.ts +6 -1
- package/dist/composition/probe/residual.d.ts.map +1 -1
- package/dist/composition/probe/residual.js +9 -7
- package/dist/composition/probe/residual.js.map +1 -1
- package/dist/composition/probe/run-manifest.js +2 -2
- package/dist/composition/probe/run-manifest.js.map +1 -1
- package/dist/composition/probe/scoring.d.ts +2 -1
- package/dist/composition/probe/scoring.d.ts.map +1 -1
- package/dist/composition/probe/scoring.js +21 -7
- package/dist/composition/probe/scoring.js.map +1 -1
- package/dist/composition/probe/search-budget.js.map +1 -1
- package/dist/composition/probe/serialize.js.map +1 -1
- package/dist/composition/probe/structure.d.ts +82 -17
- package/dist/composition/probe/structure.d.ts.map +1 -1
- package/dist/composition/probe/structure.js +129 -55
- package/dist/composition/probe/structure.js.map +1 -1
- package/dist/composition/probe/study.d.ts +35 -12
- package/dist/composition/probe/study.d.ts.map +1 -1
- package/dist/composition/probe/study.js +241 -184
- package/dist/composition/probe/study.js.map +1 -1
- package/dist/composition/probe/t-tail.d.ts +17 -0
- package/dist/composition/probe/t-tail.d.ts.map +1 -0
- package/dist/composition/probe/t-tail.js +32 -0
- package/dist/composition/probe/t-tail.js.map +1 -0
- package/dist/composition/probe/types.d.ts +6 -1
- package/dist/composition/probe/types.d.ts.map +1 -1
- package/dist/composition/probe/types.js +2 -0
- package/dist/composition/probe/types.js.map +1 -1
- package/dist/composition/proposed-bridges.d.ts +51 -13
- package/dist/composition/proposed-bridges.d.ts.map +1 -1
- package/dist/composition/proposed-bridges.js +110 -58
- package/dist/composition/proposed-bridges.js.map +1 -1
- package/dist/composition/quantities.d.ts +0 -4
- package/dist/composition/quantities.d.ts.map +1 -1
- package/dist/composition/quantities.js +5 -5
- package/dist/composition/quantities.js.map +1 -1
- package/dist/composition/quantity-clusters.d.ts +48 -0
- package/dist/composition/quantity-clusters.d.ts.map +1 -0
- package/dist/composition/quantity-clusters.js +98 -0
- package/dist/composition/quantity-clusters.js.map +1 -0
- package/dist/composition/quantity.d.ts +18 -2
- package/dist/composition/quantity.d.ts.map +1 -1
- package/dist/composition/quantity.js +35 -6
- package/dist/composition/quantity.js.map +1 -1
- package/dist/composition/rational-exponent.d.ts +40 -0
- package/dist/composition/rational-exponent.d.ts.map +1 -0
- package/dist/composition/rational-exponent.js +65 -0
- package/dist/composition/rational-exponent.js.map +1 -0
- package/dist/composition/representative-values.d.ts +22 -0
- package/dist/composition/representative-values.d.ts.map +1 -1
- package/dist/composition/representative-values.js +23 -0
- package/dist/composition/representative-values.js.map +1 -1
- package/dist/composition/retrodiction.d.ts +16 -6
- package/dist/composition/retrodiction.d.ts.map +1 -1
- package/dist/composition/retrodiction.js +36 -10
- package/dist/composition/retrodiction.js.map +1 -1
- package/dist/composition/uncertainty.js.map +1 -1
- package/dist/composition/user-equation.d.ts.map +1 -1
- package/dist/composition/user-equation.js +2 -2
- package/dist/composition/user-equation.js.map +1 -1
- package/dist/core/assignment.d.ts +19 -0
- package/dist/core/assignment.d.ts.map +1 -0
- package/dist/core/assignment.js +19 -0
- package/dist/core/assignment.js.map +1 -0
- package/dist/core/axes-registry.d.ts +8 -5
- package/dist/core/axes-registry.d.ts.map +1 -1
- package/dist/core/axes-registry.js.map +1 -1
- package/dist/core/cell.js.map +1 -1
- package/dist/core/compare.d.ts +32 -0
- package/dist/core/compare.d.ts.map +1 -0
- package/dist/core/compare.js +46 -0
- package/dist/core/compare.js.map +1 -0
- package/dist/core/constants.d.ts +35 -35
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +52 -37
- package/dist/core/constants.js.map +1 -1
- package/dist/core/data-file.d.ts +7 -0
- package/dist/core/data-file.d.ts.map +1 -1
- package/dist/core/data-file.js +17 -0
- package/dist/core/data-file.js.map +1 -1
- package/dist/core/flux-rules.js +1 -1
- package/dist/core/flux-rules.js.map +1 -1
- package/dist/core/format.d.ts +36 -0
- package/dist/core/format.d.ts.map +1 -0
- package/dist/core/format.js +39 -0
- package/dist/core/format.js.map +1 -0
- package/dist/core/hash.d.ts +14 -0
- package/dist/core/hash.d.ts.map +1 -0
- package/dist/core/hash.js +17 -0
- package/dist/core/hash.js.map +1 -0
- package/dist/core/json-schema.d.ts +3 -1
- package/dist/core/json-schema.d.ts.map +1 -1
- package/dist/core/json-schema.js +41 -16
- package/dist/core/json-schema.js.map +1 -1
- package/dist/core/labeled-tensor.d.ts +6 -1
- package/dist/core/labeled-tensor.d.ts.map +1 -1
- package/dist/core/labeled-tensor.js +18 -16
- package/dist/core/labeled-tensor.js.map +1 -1
- package/dist/core/mathts-read.d.ts +25 -0
- package/dist/core/mathts-read.d.ts.map +1 -0
- package/dist/core/mathts-read.js +51 -0
- package/dist/core/mathts-read.js.map +1 -0
- package/dist/core/regime-registry.d.ts +6 -2
- package/dist/core/regime-registry.d.ts.map +1 -1
- package/dist/core/regime-registry.js.map +1 -1
- package/dist/core/regime-rule-install.js.map +1 -1
- package/dist/core/regimes-builtins.js.map +1 -1
- package/dist/core/tensor.d.ts +7 -4
- package/dist/core/tensor.d.ts.map +1 -1
- package/dist/core/tensor.js +64 -8
- package/dist/core/tensor.js.map +1 -1
- package/dist/core/types.d.ts +5 -5
- package/dist/core/types.js.map +1 -1
- package/dist/core/universal-index.js.map +1 -1
- package/dist/diff/bridge-ast-gradient.d.ts +4 -5
- package/dist/diff/bridge-ast-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-ast-gradient.js +10 -6
- package/dist/diff/bridge-ast-gradient.js.map +1 -1
- package/dist/diff/bridge-gradient.d.ts +43 -86
- package/dist/diff/bridge-gradient.d.ts.map +1 -1
- package/dist/diff/bridge-gradient.js +40 -109
- package/dist/diff/bridge-gradient.js.map +1 -1
- package/dist/diff/bridge-specs.d.ts +16 -5
- package/dist/diff/bridge-specs.d.ts.map +1 -1
- package/dist/diff/bridge-specs.js +19 -4
- package/dist/diff/bridge-specs.js.map +1 -1
- package/dist/dimensional/algebra.d.ts +18 -0
- package/dist/dimensional/algebra.d.ts.map +1 -1
- package/dist/dimensional/algebra.js +41 -1
- package/dist/dimensional/algebra.js.map +1 -1
- package/dist/dimensional/ast-builders.d.ts +12 -4
- package/dist/dimensional/ast-builders.d.ts.map +1 -1
- package/dist/dimensional/ast-builders.js +17 -5
- package/dist/dimensional/ast-builders.js.map +1 -1
- package/dist/dimensional/ast-leaves.d.ts +81 -0
- package/dist/dimensional/ast-leaves.d.ts.map +1 -0
- package/dist/dimensional/ast-leaves.js +146 -0
- package/dist/dimensional/ast-leaves.js.map +1 -0
- package/dist/dimensional/ast-types.js.map +1 -1
- package/dist/dimensional/bridge-check.js.map +1 -1
- package/dist/dimensional/buckingham.d.ts.map +1 -1
- package/dist/dimensional/buckingham.js +15 -27
- package/dist/dimensional/buckingham.js.map +1 -1
- package/dist/dimensional/connection-validators.d.ts +2 -1
- package/dist/dimensional/connection-validators.d.ts.map +1 -1
- package/dist/dimensional/connection-validators.js.map +1 -1
- package/dist/dimensional/connection.js.map +1 -1
- package/dist/dimensional/constant-rows.d.ts.map +1 -1
- package/dist/dimensional/constant-rows.js +17 -13
- package/dist/dimensional/constant-rows.js.map +1 -1
- package/dist/dimensional/constants.d.ts +5 -6
- package/dist/dimensional/constants.d.ts.map +1 -1
- package/dist/dimensional/constants.js +5 -6
- package/dist/dimensional/constants.js.map +1 -1
- package/dist/dimensional/curvature-composite.js.map +1 -1
- package/dist/dimensional/curvature-invariants.js.map +1 -1
- package/dist/dimensional/curvature.js.map +1 -1
- package/dist/dimensional/dimension-inference.d.ts.map +1 -1
- package/dist/dimensional/dimension-inference.js +1 -2
- package/dist/dimensional/dimension-inference.js.map +1 -1
- package/dist/dimensional/dimension-spec.d.ts +13 -7
- package/dist/dimensional/dimension-spec.d.ts.map +1 -1
- package/dist/dimensional/dimension-spec.js +49 -23
- package/dist/dimensional/dimension-spec.js.map +1 -1
- package/dist/dimensional/einstein-equation.js.map +1 -1
- package/dist/dimensional/errors.d.ts +4 -2
- package/dist/dimensional/errors.d.ts.map +1 -1
- package/dist/dimensional/errors.js +3 -17
- package/dist/dimensional/errors.js.map +1 -1
- package/dist/dimensional/exact-scale.d.ts +0 -17
- package/dist/dimensional/exact-scale.d.ts.map +1 -1
- package/dist/dimensional/exact-scale.js +8 -8
- package/dist/dimensional/exact-scale.js.map +1 -1
- package/dist/dimensional/field-equation-helpers.js.map +1 -1
- package/dist/dimensional/formula-names.js.map +1 -1
- package/dist/dimensional/fresh-label.js.map +1 -1
- package/dist/dimensional/friedmann-equation.d.ts +3 -3
- package/dist/dimensional/friedmann-equation.js +3 -3
- package/dist/dimensional/friedmann-equation.js.map +1 -1
- package/dist/dimensional/gauge-field.d.ts +2 -3
- package/dist/dimensional/gauge-field.d.ts.map +1 -1
- package/dist/dimensional/gauge-field.js +2 -3
- package/dist/dimensional/gauge-field.js.map +1 -1
- package/dist/dimensional/hyphen-names.d.ts +12 -2
- package/dist/dimensional/hyphen-names.d.ts.map +1 -1
- package/dist/dimensional/hyphen-names.js +45 -12
- package/dist/dimensional/hyphen-names.js.map +1 -1
- package/dist/dimensional/killing-validators.js.map +1 -1
- package/dist/dimensional/klein-gordon-equation.js.map +1 -1
- package/dist/dimensional/metric-validators.d.ts +2 -1
- package/dist/dimensional/metric-validators.d.ts.map +1 -1
- package/dist/dimensional/metric-validators.js.map +1 -1
- package/dist/dimensional/metric.d.ts.map +1 -1
- package/dist/dimensional/metric.js +0 -1
- package/dist/dimensional/metric.js.map +1 -1
- package/dist/dimensional/natural-units.js.map +1 -1
- package/dist/dimensional/quantity-registry.d.ts +13 -0
- package/dist/dimensional/quantity-registry.d.ts.map +1 -1
- package/dist/dimensional/quantity-registry.js +14 -6
- package/dist/dimensional/quantity-registry.js.map +1 -1
- package/dist/dimensional/rg-flow.js.map +1 -1
- package/dist/dimensional/stress-energy-validators.js.map +1 -1
- package/dist/dimensional/symbolic-constants.d.ts +9 -0
- package/dist/dimensional/symbolic-constants.d.ts.map +1 -1
- package/dist/dimensional/symbolic-constants.js +20 -3
- package/dist/dimensional/symbolic-constants.js.map +1 -1
- package/dist/dimensional/tensor-trace.js.map +1 -1
- package/dist/dimensional/tensor.js.map +1 -1
- package/dist/dimensional/types.d.ts +36 -0
- package/dist/dimensional/types.d.ts.map +1 -1
- package/dist/dimensional/types.js +45 -7
- package/dist/dimensional/types.js.map +1 -1
- package/dist/dimensional/unit-convention.d.ts +0 -2
- package/dist/dimensional/unit-convention.d.ts.map +1 -1
- package/dist/dimensional/unit-convention.js +2 -2
- package/dist/dimensional/unit-convention.js.map +1 -1
- package/dist/dimensional/unit-data.d.ts.map +1 -1
- package/dist/dimensional/unit-data.js +11 -7
- package/dist/dimensional/unit-data.js.map +1 -1
- package/dist/dimensional/units.d.ts.map +1 -1
- package/dist/dimensional/units.js +38 -20
- package/dist/dimensional/units.js.map +1 -1
- package/dist/dimensional/validator-registry.js.map +1 -1
- package/dist/dimensional/validator.d.ts +0 -16
- package/dist/dimensional/validator.d.ts.map +1 -1
- package/dist/dimensional/validator.js +65 -29
- package/dist/dimensional/validator.js.map +1 -1
- package/dist/dimensional/weyl-validators.js.map +1 -1
- package/dist/index.d.ts +59 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -24
- package/dist/index.js.map +1 -1
- package/dist/numerical/bianchi-residual.js.map +1 -1
- package/dist/numerical/binding-value.d.ts +11 -6
- package/dist/numerical/binding-value.d.ts.map +1 -1
- package/dist/numerical/binding-value.js +126 -122
- package/dist/numerical/binding-value.js.map +1 -1
- package/dist/numerical/christoffel-flat.d.ts.map +1 -1
- package/dist/numerical/christoffel-flat.js +3 -2
- package/dist/numerical/christoffel-flat.js.map +1 -1
- package/dist/numerical/connection-lowering-helpers.js.map +1 -1
- package/dist/numerical/covariant-eikonal.d.ts.map +1 -1
- package/dist/numerical/covariant-eikonal.js +36 -13
- package/dist/numerical/covariant-eikonal.js.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.d.ts +20 -0
- package/dist/numerical/curvature-lowering-helpers.d.ts.map +1 -1
- package/dist/numerical/curvature-lowering-helpers.js +9 -5
- package/dist/numerical/curvature-lowering-helpers.js.map +1 -1
- package/dist/numerical/derivative-lowering.js.map +1 -1
- package/dist/numerical/einstein-equation.js.map +1 -1
- package/dist/numerical/engine-registry.js.map +1 -1
- package/dist/numerical/errors.d.ts +7 -3
- package/dist/numerical/errors.d.ts.map +1 -1
- package/dist/numerical/errors.js +5 -8
- package/dist/numerical/errors.js.map +1 -1
- package/dist/numerical/evaluator-uncertainty.d.ts.map +1 -1
- package/dist/numerical/evaluator-uncertainty.js +19 -2
- package/dist/numerical/evaluator-uncertainty.js.map +1 -1
- package/dist/numerical/finite-difference.d.ts +22 -0
- package/dist/numerical/finite-difference.d.ts.map +1 -0
- package/dist/numerical/finite-difference.js +27 -0
- package/dist/numerical/finite-difference.js.map +1 -0
- package/dist/numerical/formula-contract.d.ts +63 -7
- package/dist/numerical/formula-contract.d.ts.map +1 -1
- package/dist/numerical/formula-contract.js +61 -42
- package/dist/numerical/formula-contract.js.map +1 -1
- package/dist/numerical/formula-dimension.d.ts +8 -7
- package/dist/numerical/formula-dimension.d.ts.map +1 -1
- package/dist/numerical/formula-dimension.js +58 -36
- package/dist/numerical/formula-dimension.js.map +1 -1
- package/dist/numerical/formula-mathts.d.ts.map +1 -1
- package/dist/numerical/formula-mathts.js +5 -2
- package/dist/numerical/formula-mathts.js.map +1 -1
- package/dist/numerical/formula-registry.d.ts +13 -3
- package/dist/numerical/formula-registry.d.ts.map +1 -1
- package/dist/numerical/formula-registry.js +7 -2
- package/dist/numerical/formula-registry.js.map +1 -1
- package/dist/numerical/geodesic-integrator.d.ts.map +1 -1
- package/dist/numerical/geodesic-integrator.js +22 -14
- package/dist/numerical/geodesic-integrator.js.map +1 -1
- package/dist/numerical/geometrized.d.ts.map +1 -1
- package/dist/numerical/geometrized.js +0 -1
- package/dist/numerical/geometrized.js.map +1 -1
- package/dist/numerical/gl4-integrator.d.ts +28 -27
- package/dist/numerical/gl4-integrator.d.ts.map +1 -1
- package/dist/numerical/gl4-integrator.js +41 -42
- package/dist/numerical/gl4-integrator.js.map +1 -1
- package/dist/numerical/grid-field.js.map +1 -1
- package/dist/numerical/index.js.map +1 -1
- package/dist/numerical/input-validation.d.ts +3 -6
- package/dist/numerical/input-validation.d.ts.map +1 -1
- package/dist/numerical/input-validation.js +4 -8
- package/dist/numerical/input-validation.js.map +1 -1
- package/dist/numerical/killing.d.ts +8 -5
- package/dist/numerical/killing.d.ts.map +1 -1
- package/dist/numerical/killing.js.map +1 -1
- package/dist/numerical/klein-gordon.js.map +1 -1
- package/dist/numerical/kretschmann.js.map +1 -1
- package/dist/numerical/lowering-utils.js.map +1 -1
- package/dist/numerical/lowering.d.ts.map +1 -1
- package/dist/numerical/lowering.js +7 -17
- package/dist/numerical/lowering.js.map +1 -1
- package/dist/numerical/mathts-engine.d.ts.map +1 -1
- package/dist/numerical/mathts-engine.js +16 -25
- package/dist/numerical/mathts-engine.js.map +1 -1
- package/dist/numerical/metric-inverse.d.ts.map +1 -1
- package/dist/numerical/metric-inverse.js +83 -46
- package/dist/numerical/metric-inverse.js.map +1 -1
- package/dist/numerical/null-ic.js.map +1 -1
- package/dist/numerical/null-ray-integrator.d.ts +2 -1
- package/dist/numerical/null-ray-integrator.d.ts.map +1 -1
- package/dist/numerical/null-ray-integrator.js +12 -12
- package/dist/numerical/null-ray-integrator.js.map +1 -1
- package/dist/numerical/painleve-gullstrand-metric.js +2 -2
- package/dist/numerical/painleve-gullstrand-metric.js.map +1 -1
- package/dist/numerical/pderiv.d.ts.map +1 -1
- package/dist/numerical/pderiv.js +9 -2
- package/dist/numerical/pderiv.js.map +1 -1
- package/dist/numerical/perihelion-finder.d.ts +0 -36
- package/dist/numerical/perihelion-finder.d.ts.map +1 -1
- package/dist/numerical/perihelion-finder.js +41 -87
- package/dist/numerical/perihelion-finder.js.map +1 -1
- package/dist/numerical/quadrature.d.ts +5 -2
- package/dist/numerical/quadrature.d.ts.map +1 -1
- package/dist/numerical/quadrature.js +19 -4
- package/dist/numerical/quadrature.js.map +1 -1
- package/dist/numerical/rk4-trajectory.d.ts +10 -0
- package/dist/numerical/rk4-trajectory.d.ts.map +1 -0
- package/dist/numerical/rk4-trajectory.js +37 -0
- package/dist/numerical/rk4-trajectory.js.map +1 -0
- package/dist/numerical/schwarzschild.d.ts +14 -0
- package/dist/numerical/schwarzschild.d.ts.map +1 -0
- package/dist/numerical/schwarzschild.js +17 -0
- package/dist/numerical/schwarzschild.js.map +1 -0
- package/dist/numerical/spacetime-metrics.d.ts +25 -19
- package/dist/numerical/spacetime-metrics.d.ts.map +1 -1
- package/dist/numerical/spacetime-metrics.js +180 -286
- package/dist/numerical/spacetime-metrics.js.map +1 -1
- package/dist/numerical/statistics.d.ts +24 -0
- package/dist/numerical/statistics.d.ts.map +1 -0
- package/dist/numerical/statistics.js +52 -0
- package/dist/numerical/statistics.js.map +1 -0
- package/dist/numerical/strides.js.map +1 -1
- package/dist/numerical/tensor-engine.d.ts +30 -5
- package/dist/numerical/tensor-engine.d.ts.map +1 -1
- package/dist/numerical/tensor-engine.js +12 -0
- package/dist/numerical/tensor-engine.js.map +1 -1
- package/dist/numerical/types.js.map +1 -1
- package/dist/numerical/weyl-lowering.js.map +1 -1
- package/dist/relations/category.js.map +1 -1
- package/dist/relations/composition-table.d.ts +4 -4
- package/dist/relations/composition-table.js +4 -4
- package/dist/relations/composition-table.js.map +1 -1
- package/dist/relations/conventions.js.map +1 -1
- package/dist/relations/domain-regimes.js.map +1 -1
- package/dist/relations/regime-registration.js.map +1 -1
- package/dist/relations/regime-vocabularies.js.map +1 -1
- package/dist/relations/regime.d.ts +28 -8
- package/dist/relations/regime.d.ts.map +1 -1
- package/dist/relations/regime.js +44 -15
- package/dist/relations/regime.js.map +1 -1
- package/dist/relations/types.d.ts +18 -5
- package/dist/relations/types.d.ts.map +1 -1
- package/dist/relations/types.js +5 -3
- package/dist/relations/types.js.map +1 -1
- package/package.json +16 -20
- package/dist/bridges/registry.d.ts +0 -60
- package/dist/bridges/registry.d.ts.map +0 -1
- package/dist/bridges/registry.js +0 -87
- package/dist/bridges/registry.js.map +0 -1
- package/dist/cli/poster-source.d.ts +0 -154
- package/dist/cli/poster-source.d.ts.map +0 -1
- package/dist/cli/poster-source.js +0 -184
- package/dist/cli/poster-source.js.map +0 -1
|
@@ -8,16 +8,30 @@ function clamp01(x) {
|
|
|
8
8
|
return 0;
|
|
9
9
|
return Math.min(1, Math.max(0, x));
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Robustness is what the falsification batteries recorded: the fraction of
|
|
13
|
+
* the batteries that ran and passed (an `inconclusive` battery did not pass).
|
|
14
|
+
* It is not read from the status label: a survivor awaiting expert review
|
|
15
|
+
* was once scored 1 by its label alone, while two of the five listed
|
|
16
|
+
* batteries could never fail (9.0.0 audit §4 Low). Without a falsification
|
|
17
|
+
* record only the holdout stage is known: 0.7 past the holdout, 0.2 before.
|
|
18
|
+
*/
|
|
19
|
+
function robustnessOf(record, falsification) {
|
|
20
|
+
if (falsification !== undefined && falsification.records.length > 0) {
|
|
21
|
+
const passed = falsification.records.filter((r) => r.outcome === 'pass').length;
|
|
22
|
+
return passed / falsification.records.length;
|
|
23
|
+
}
|
|
24
|
+
return record.status === 'heldout-supported' ||
|
|
25
|
+
record.status === 'falsification-survivor' ||
|
|
26
|
+
record.status === 'expert-review-required'
|
|
27
|
+
? 0.7
|
|
28
|
+
: 0.2;
|
|
29
|
+
}
|
|
11
30
|
/** Build a score vector. @internal */
|
|
12
|
-
export function scoreCandidate(record, empirical = 0, corpusDistance = 1) {
|
|
31
|
+
export function scoreCandidate(record, empirical = 0, corpusDistance = 1, falsification) {
|
|
13
32
|
const parsimony = clamp01(1 / (1 + record.complexity.astNodes / 8));
|
|
14
33
|
const validity = record.fingerprint.dimensionalSignature === 'invalid' ? 0 : 1;
|
|
15
|
-
const robustness = record
|
|
16
|
-
record.status === 'expert-review-required'
|
|
17
|
-
? 1
|
|
18
|
-
: record.status === 'heldout-supported'
|
|
19
|
-
? 0.7
|
|
20
|
-
: 0.2;
|
|
34
|
+
const robustness = robustnessOf(record, falsification);
|
|
21
35
|
return {
|
|
22
36
|
validity,
|
|
23
37
|
empirical: clamp01(empirical),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../../src/composition/probe/scoring.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../../src/composition/probe/scoring.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,SAAS,OAAO,CAAC,CAAS;IACxB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC;IAClC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,YAAY,CAAC,MAA4B,EAAE,aAAwC;IAC1F,IAAI,aAAa,KAAK,SAAS,IAAI,aAAa,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpE,MAAM,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;QAChF,OAAO,MAAM,GAAG,aAAa,CAAC,OAAO,CAAC,MAAM,CAAC;IAC/C,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,KAAK,mBAAmB;QAC1C,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AU,UAAU,CACxB,KAAuE;IAEvE,OAAO,KAAK;SACT,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QACZ,GAAG,EAAE;QACL,MAAM,EAAE,CAAC,KAAK,CAAC,IAAI,CACjB,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,IAAI,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAClF;KACF,CAAC,CAAC;SACF,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AACnG,CAAC","sourcesContent":["/**\n * Pareto scoring for probe candidates. Does not touch `VettedCandidate.score`.\n *\n * @module composition/probe/scoring\n */\n\nimport type { ProbeCandidateRecord, ScoreVector } from './types.js';\nimport type { FalsifyResult } from './falsify.js';\n\nfunction clamp01(x: number): number {\n if (!Number.isFinite(x)) return 0;\n return Math.min(1, Math.max(0, x));\n}\n\n/**\n * Robustness is what the falsification batteries recorded: the fraction of\n * the batteries that ran and passed (an `inconclusive` battery did not pass).\n * It is not read from the status label: a survivor awaiting expert review\n * was once scored 1 by its label alone, while two of the five listed\n * batteries could never fail (9.0.0 audit §4 Low). Without a falsification\n * record only the holdout stage is known: 0.7 past the holdout, 0.2 before.\n */\nfunction robustnessOf(record: ProbeCandidateRecord, falsification: FalsifyResult | undefined): number {\n if (falsification !== undefined && falsification.records.length > 0) {\n const passed = falsification.records.filter((r) => r.outcome === 'pass').length;\n return passed / falsification.records.length;\n }\n return record.status === 'heldout-supported' ||\n record.status === 'falsification-survivor' ||\n record.status === 'expert-review-required'\n ? 0.7\n : 0.2;\n}\n\n/** Build a score vector. @internal */\nexport function scoreCandidate(\n record: ProbeCandidateRecord,\n empirical = 0,\n corpusDistance = 1,\n falsification?: FalsifyResult,\n): ScoreVector {\n const parsimony = clamp01(1 / (1 + record.complexity.astNodes / 8));\n const validity = record.fingerprint.dimensionalSignature === 'invalid' ? 0 : 1;\n const robustness = robustnessOf(record, falsification);\n return {\n validity,\n empirical: clamp01(empirical),\n parsimony,\n corpusDistance: clamp01(corpusDistance),\n robustness,\n };\n}\n\nfunction dominates(a: ScoreVector, b: ScoreVector): boolean {\n const keys: (keyof ScoreVector)[] = [\n 'validity',\n 'empirical',\n 'parsimony',\n 'corpusDistance',\n 'robustness',\n ];\n let better = false;\n for (const k of keys) {\n if (a[k] < b[k] - 1e-12) return false;\n if (a[k] > b[k] + 1e-12) better = true;\n }\n return better;\n}\n\nexport interface RankedCandidate {\n readonly record: ProbeCandidateRecord;\n readonly scores: ScoreVector;\n readonly pareto: boolean;\n}\n\n/** Pareto front (non-dominated) plus the rest, stable by id. @internal */\nexport function rankPareto(\n items: readonly { record: ProbeCandidateRecord; scores: ScoreVector }[],\n): RankedCandidate[] {\n return items\n .map((it) => ({\n ...it,\n pareto: !items.some(\n (other) => other.record.id !== it.record.id && dominates(other.scores, it.scores),\n ),\n }))\n .sort((a, b) => Number(b.pareto) - Number(a.pareto) || a.record.id.localeCompare(b.record.id));\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-budget.js","sourceRoot":"","sources":["../../../src/composition/probe/search-budget.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;GAIG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAUnD,qCAAqC;AACrC,MAAM,UAAU,UAAU,CAAC,MAAM,GAAiB,qBAAqB;IACrE,OAAO;QACL,MAAM;QACN,0EAA0E;QAC1E,yEAAyE;QACzE,2EAA2E;QAC3E,mEAAmE;QACnE,WAAW,EAAE,WAAW,CAAC,GAAG,EAAE;QAC9B,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;KACf,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,aAAa;QAAE,OAAO,iBAAiB,CAAC;IACvE,IAAI,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,cAAc;QAAE,OAAO,kBAAkB,CAAC;IAC1E,IAAI,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,cAAc;QAAE,OAAO,YAAY,CAAC;IACxF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IACjD,OAAO,gBAAgB,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
|
1
|
+
{"version":3,"file":"search-budget.js","sourceRoot":"","sources":["../../../src/composition/probe/search-budget.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;GAIG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAUnD,qCAAqC;AACrC,MAAM,UAAU,UAAU,CAAC,MAAM,GAAiB,qBAAqB;IACrE,OAAO;QACL,MAAM;QACN,0EAA0E;QAC1E,yEAAyE;QACzE,2EAA2E;QAC3E,mEAAmE;QACnE,WAAW,EAAE,WAAW,CAAC,GAAG,EAAE;QAC9B,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,CAAC;KACf,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IACjD,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,KAAK,CAAC,UAAU,IAAI,MAAM,CAAC,aAAa;QAAE,OAAO,iBAAiB,CAAC;IACvE,IAAI,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,cAAc;QAAE,OAAO,kBAAkB,CAAC;IAC1E,IAAI,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,WAAW,IAAI,MAAM,CAAC,cAAc;QAAE,OAAO,YAAY,CAAC;IACxF,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IACjD,OAAO,gBAAgB,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;AAC/C,CAAC","sourcesContent":["/**\n * Search-budget accounting for Product B. Product A (`rankDiscoveries`) is\n * already finite and must not grow AST-depth caps.\n *\n * @module composition/probe/search-budget\n */\n\nimport type { SearchBudget, SearchStopReason } from './types.js';\nimport { DEFAULT_SEARCH_BUDGET } from './types.js';\n\n/**\n * The default search budget.\n *\n * @internal\n */\nexport { DEFAULT_SEARCH_BUDGET } from './types.js';\n\n/** Mutable counters for one run. @internal */\nexport interface BudgetState {\n readonly budget: SearchBudget;\n readonly startedAtMs: number;\n candidates: number;\n evaluations: number;\n}\n\n/** Open a budget clock. @internal */\nexport function openBudget(budget: SearchBudget = DEFAULT_SEARCH_BUDGET): BudgetState {\n return {\n budget,\n // performance.now() moves inside a millisecond. Date.now() does not, so a\n // budget under 1 ms — and a 1 ms budget on a search that finishes in the\n // same tick — never returned time-limit, and a replay of that search could\n // disagree with the recording while still being called reproduced.\n startedAtMs: performance.now(),\n candidates: 0,\n evaluations: 0,\n };\n}\n\n/**\n * First violated stop reason, or `undefined` if the search may continue.\n * @internal\n */\nexport function budgetStopReason(state: BudgetState): SearchStopReason | undefined {\n const { budget } = state;\n if (state.candidates >= budget.maxCandidates) return 'candidate-limit';\n if (state.evaluations >= budget.maxEvaluations) return 'evaluation-limit';\n if (performance.now() - state.startedAtMs >= budget.maxWallClockMs) return 'time-limit';\n return undefined;\n}\n\n/** True when another candidate may be emitted. @internal */\nexport function canEmitCandidate(state: BudgetState): boolean {\n return budgetStopReason(state) === undefined;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/composition/probe/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"serialize.js","sourceRoot":"","sources":["../../../src/composition/probe/serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["/**\n * Probe-profile re-exports of the one canonical-JSON module.\n *\n * Object keys are sorted lexicographically; `undefined` properties are omitted;\n * arrays keep encounter order. A `Date` serializes as ISO-8601. An `undefined`\n * array hole becomes `null`.\n *\n * Hashes use SHA-256 over this canonical form. Experimental — not a public\n * API stability surface (`src/index.ts` does not re-export this module).\n *\n * @module composition/probe/serialize\n */\n\nexport { canonicalJson, sha256Hex, hashCanonical } from '../canonical-json.js';\n"]}
|
|
@@ -1,51 +1,116 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cheap structure probes: regime changepoint, scale symmetry,
|
|
2
|
+
* Cheap structure probes as TESTS: a regime changepoint, a scale symmetry, a
|
|
3
|
+
* conserved dQ/dt. Each verdict is scale-free: the same series scaled by 1e6
|
|
4
|
+
* or by 1e-6 gets the same answer, because every threshold is in units of
|
|
5
|
+
* the series' own scatter, never in the units of y.
|
|
3
6
|
*
|
|
4
7
|
* Task-0 style: recover a synthetic signal or honestly abstain. Never flips
|
|
5
8
|
* `axes.ts` `gated`.
|
|
6
9
|
*
|
|
7
10
|
* @internal
|
|
8
11
|
*/
|
|
12
|
+
/** A series sampled at `x` with values `y`, scanned for a step in its mean. @internal */
|
|
9
13
|
export interface ChangepointInput {
|
|
10
14
|
readonly x: readonly number[];
|
|
11
15
|
readonly y: readonly number[];
|
|
16
|
+
/** Significance level of the permutation test; default 0.01. */
|
|
17
|
+
readonly alpha?: number;
|
|
18
|
+
/** Permutation resamples of the null; default 999. */
|
|
19
|
+
readonly resamples?: number;
|
|
20
|
+
/** Seed of the permutation null (MathTS `permutationTest`); default 20261015, never the clock. */
|
|
21
|
+
readonly seed?: number;
|
|
12
22
|
}
|
|
23
|
+
/** The best split of {@link detectMeanChangepoint}, its tests, or an abstention with its reason. @internal */
|
|
13
24
|
export interface ChangepointResult {
|
|
25
|
+
/** The split index (the right segment starts here) when the step is significant; null otherwise. */
|
|
14
26
|
readonly index: number | null;
|
|
27
|
+
/** |Welch t| at the best split: the step in units of its own standard error (scale-free). */
|
|
15
28
|
readonly score: number;
|
|
29
|
+
/** μ_right − μ_left at the best split, in the units of y; null when nothing was scanned. */
|
|
30
|
+
readonly meanDifference: number | null;
|
|
31
|
+
/** MathTS `studentTTest` at the best split: the Welch t and its degrees of freedom. */
|
|
32
|
+
readonly tStatistic: number | null;
|
|
33
|
+
readonly degreesOfFreedom: number | null;
|
|
34
|
+
/**
|
|
35
|
+
* The direct two-sided Welch p at the best split (one split, as if chosen in advance; not
|
|
36
|
+
* corrected for the scan over splits, which is what `pPermutation` is for).
|
|
37
|
+
*/
|
|
38
|
+
readonly pWelch: number | null;
|
|
39
|
+
/** P(max over splits of |t| ≥ observed) under a seeded permutation of the series. */
|
|
40
|
+
readonly pPermutation: number | null;
|
|
16
41
|
readonly abstained: boolean;
|
|
17
42
|
readonly reason?: string;
|
|
18
43
|
}
|
|
19
44
|
/**
|
|
20
|
-
* Two-mean changepoint
|
|
21
|
-
*
|
|
45
|
+
* Two-mean changepoint as a test. The best split maximises Welch's t over
|
|
46
|
+
* the splits that leave at least two samples on each side; MathTS
|
|
47
|
+
* `studentTTest` gives the t, the degrees of freedom and the direct p at that
|
|
48
|
+
* split. Because the split was CHOSEN by the scan, that p is not the test:
|
|
49
|
+
* the verdict is the seeded permutation null (MathTS `permutationTest`) of
|
|
50
|
+
* the maximum over splits, flagged when `pPermutation < alpha` (default
|
|
51
|
+
* 0.01). Every quantity is in units of the series' scatter, so a series and
|
|
52
|
+
* its copy scaled by any factor get one verdict. Abstains below six samples.
|
|
22
53
|
*
|
|
23
54
|
* @internal
|
|
24
55
|
*/
|
|
25
|
-
export declare function detectMeanChangepoint(input: ChangepointInput
|
|
56
|
+
export declare function detectMeanChangepoint(input: ChangepointInput): ChangepointResult;
|
|
57
|
+
/** Positive samples `(x, y)` whose log-log slope is the scale exponent. @internal */
|
|
26
58
|
export interface ScaleSymmetryInput {
|
|
27
59
|
readonly x: readonly number[];
|
|
28
60
|
readonly y: readonly number[];
|
|
29
61
|
}
|
|
62
|
+
/** The log-log slope with its standard error and the direct two-sided p of slope = 0. @internal */
|
|
63
|
+
export interface ScaleExponentResult {
|
|
64
|
+
readonly exponent: number | null;
|
|
65
|
+
/** Standard error of the slope (MathTS `linearRegression.stdErr`). */
|
|
66
|
+
readonly stdErr: number | null;
|
|
67
|
+
/** P(|T_{n−2}| ≥ |exponent/stdErr|), the direct tail ({@link studentTwoSidedP}); null below n = 3. */
|
|
68
|
+
readonly pValue: number | null;
|
|
69
|
+
/** The positive pairs the fit used. */
|
|
70
|
+
readonly n: number;
|
|
71
|
+
readonly abstained: boolean;
|
|
72
|
+
readonly reason?: string;
|
|
73
|
+
}
|
|
30
74
|
/**
|
|
31
|
-
* Ordinary-least-squares log-log slope
|
|
75
|
+
* Ordinary-least-squares log-log slope, MathTS `linearRegression` on the
|
|
76
|
+
* logs, with its standard error. The p-value is NOT the one MathTS reports
|
|
77
|
+
* (`2·(1 − CDF)`, which rounds a far tail to 0): it is the direct t tail from
|
|
78
|
+
* `betainc`. Abstains if x or y are non-positive, or when the log-x spread
|
|
79
|
+
* (core `sumSquaredDeviations`, times n: the normal-equation denominator)
|
|
80
|
+
* is degenerate.
|
|
32
81
|
*
|
|
33
82
|
* @internal
|
|
34
83
|
*/
|
|
35
|
-
export declare function estimateScaleExponent(input: ScaleSymmetryInput):
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
84
|
+
export declare function estimateScaleExponent(input: ScaleSymmetryInput): ScaleExponentResult;
|
|
85
|
+
/** The verdict of {@link probeConservation}: no drift in q beyond k standard errors of its slope. @internal */
|
|
86
|
+
export interface ConservationResult {
|
|
87
|
+
readonly conserved: boolean;
|
|
88
|
+
/** Mean |dq/dt| from MathTS `gradient` (second-order central differences inside, one-sided at the ends). */
|
|
89
|
+
readonly meanAbsRate: number;
|
|
90
|
+
/** The slope of MathTS `linearRegression(t, q)` and its standard error. */
|
|
91
|
+
readonly slope: number | null;
|
|
92
|
+
readonly stdErr: number | null;
|
|
93
|
+
/** The multiple of the standard error a drift must exceed to count. */
|
|
94
|
+
readonly k: number;
|
|
95
|
+
readonly abstained: boolean;
|
|
96
|
+
readonly reason?: string;
|
|
97
|
+
}
|
|
40
98
|
/**
|
|
41
|
-
*
|
|
99
|
+
* Conservation probe as a test: q is conserved when the linear drift
|
|
100
|
+
* `slope` of `linearRegression(t, q)` satisfies |slope| ≤ k·stdErr. The
|
|
101
|
+
* standard error comes from the residual scatter of the same series, so the
|
|
102
|
+
* verdict is scale-free. k = 3 by default: a drift within three standard
|
|
103
|
+
* errors is not distinguishable from none at the series' own noise (a
|
|
104
|
+
* two-sided 0.27% under Gaussian residuals), the usual working threshold
|
|
105
|
+
* for "no effect seen". The test sees a linear drift only; a quantity that
|
|
106
|
+
* oscillates without drifting passes. The mean |dq/dt| is reported beside
|
|
107
|
+
* the verdict from MathTS `gradient` (second order inside the series), not
|
|
108
|
+
* from first-order forward differences, and never decides it. Abstains below
|
|
109
|
+
* three samples or when t is not strictly increasing.
|
|
42
110
|
*
|
|
43
111
|
* @internal
|
|
44
112
|
*/
|
|
45
|
-
export declare function probeConservation(q: readonly number[], t: readonly number[],
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
abstained: boolean;
|
|
49
|
-
reason?: string;
|
|
50
|
-
};
|
|
113
|
+
export declare function probeConservation(q: readonly number[], t: readonly number[], opts?: {
|
|
114
|
+
readonly k?: number;
|
|
115
|
+
}): ConservationResult;
|
|
51
116
|
//# sourceMappingURL=structure.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../../src/composition/probe/structure.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../../../src/composition/probe/structure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,yFAAyF;AACzF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,sDAAsD;IACtD,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,kGAAkG;IAClG,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,8GAA8G;AAC9G,MAAM,WAAW,iBAAiB;IAChC,oGAAoG;IACpG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,6FAA6F;IAC7F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,4FAA4F;IAC5F,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,uFAAuF;IACvF,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,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,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,SAAS,MAAM,EAAE,EACpB,CAAC,EAAE,SAAS,MAAM,EAAE,EACpB,IAAI,GAAE;IAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,CAAA;CAAO,GACjC,kBAAkB,CAkBpB"}
|
|
@@ -1,42 +1,115 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Cheap structure probes: regime changepoint, scale symmetry,
|
|
2
|
+
* Cheap structure probes as TESTS: a regime changepoint, a scale symmetry, a
|
|
3
|
+
* conserved dQ/dt. Each verdict is scale-free: the same series scaled by 1e6
|
|
4
|
+
* or by 1e-6 gets the same answer, because every threshold is in units of
|
|
5
|
+
* the series' own scatter, never in the units of y.
|
|
3
6
|
*
|
|
4
7
|
* Task-0 style: recover a synthetic signal or honestly abstain. Never flips
|
|
5
8
|
* `axes.ts` `gated`.
|
|
6
9
|
*
|
|
7
10
|
* @internal
|
|
8
11
|
*/
|
|
12
|
+
import { pairwiseSum, sumSquaredDeviations } from '@danielsimonjr/mathts-core';
|
|
13
|
+
import { gradient, linearRegression, permutationTest, studentTTest } from '@danielsimonjr/mathts-functions';
|
|
14
|
+
import { meanOf } from '../../numerical/statistics.js';
|
|
15
|
+
import { studentTwoSidedP } from './t-tail.js';
|
|
16
|
+
/** The smallest segment a split may leave on either side. */
|
|
17
|
+
const MIN_SEGMENT = 2;
|
|
9
18
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
19
|
+
* |Welch t| at every admissible split of a series, from centred prefix sums:
|
|
20
|
+
* O(n) for the scan the permutation null repeats. Two segments with no
|
|
21
|
+
* scatter and different means give +Infinity; equal means give 0.
|
|
22
|
+
*/
|
|
23
|
+
function welchScan(y) {
|
|
24
|
+
const n = y.length;
|
|
25
|
+
const mean = meanOf(y);
|
|
26
|
+
const c = y.map((v) => v - mean);
|
|
27
|
+
const s1 = new Float64Array(n + 1);
|
|
28
|
+
const s2 = new Float64Array(n + 1);
|
|
29
|
+
for (let i = 0; i < n; i++) {
|
|
30
|
+
s1[i + 1] = s1[i] + c[i];
|
|
31
|
+
s2[i + 1] = s2[i] + c[i] * c[i];
|
|
32
|
+
}
|
|
33
|
+
let best = -1;
|
|
34
|
+
let bestIdx = MIN_SEGMENT;
|
|
35
|
+
for (let i = MIN_SEGMENT; i <= n - MIN_SEGMENT; i++) {
|
|
36
|
+
const nL = i;
|
|
37
|
+
const nR = n - i;
|
|
38
|
+
const mL = s1[i] / nL;
|
|
39
|
+
const mR = (s1[n] - s1[i]) / nR;
|
|
40
|
+
const vL = Math.max(0, s2[i] - nL * mL * mL) / (nL - 1);
|
|
41
|
+
const vR = Math.max(0, s2[n] - s2[i] - nR * mR * mR) / (nR - 1);
|
|
42
|
+
const se = Math.sqrt(vL / nL + vR / nR);
|
|
43
|
+
const d = Math.abs(mL - mR);
|
|
44
|
+
const t = se > 0 ? d / se : d > 0 ? Number.POSITIVE_INFINITY : 0;
|
|
45
|
+
if (t > best) {
|
|
46
|
+
best = t;
|
|
47
|
+
bestIdx = i;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return { best, bestIdx };
|
|
51
|
+
}
|
|
52
|
+
/** The max-|t| statistic of a permuted series, in the two-sample form `permutationTest` shuffles. */
|
|
53
|
+
const maxWelch = (a, b) => welchScan([...a, ...b]).best;
|
|
54
|
+
/**
|
|
55
|
+
* Two-mean changepoint as a test. The best split maximises Welch's t over
|
|
56
|
+
* the splits that leave at least two samples on each side; MathTS
|
|
57
|
+
* `studentTTest` gives the t, the degrees of freedom and the direct p at that
|
|
58
|
+
* split. Because the split was CHOSEN by the scan, that p is not the test:
|
|
59
|
+
* the verdict is the seeded permutation null (MathTS `permutationTest`) of
|
|
60
|
+
* the maximum over splits, flagged when `pPermutation < alpha` (default
|
|
61
|
+
* 0.01). Every quantity is in units of the series' scatter, so a series and
|
|
62
|
+
* its copy scaled by any factor get one verdict. Abstains below six samples.
|
|
12
63
|
*
|
|
13
64
|
* @internal
|
|
14
65
|
*/
|
|
15
|
-
export function detectMeanChangepoint(input
|
|
66
|
+
export function detectMeanChangepoint(input) {
|
|
16
67
|
const { x, y } = input;
|
|
68
|
+
const alpha = input.alpha ?? 0.01;
|
|
69
|
+
const resamples = input.resamples ?? 999;
|
|
70
|
+
const seed = input.seed ?? 20261015;
|
|
71
|
+
const none = { meanDifference: null, tStatistic: null, degreesOfFreedom: null, pWelch: null, pPermutation: null };
|
|
17
72
|
if (x.length !== y.length || x.length < 6) {
|
|
18
|
-
return { index: null, score: 0, abstained: true, reason: 'series too short' };
|
|
73
|
+
return { index: null, score: 0, ...none, abstained: true, reason: 'series too short' };
|
|
19
74
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
for (let i = 2; i < y.length - 2; i++) {
|
|
23
|
-
const left = y.slice(0, i);
|
|
24
|
-
const right = y.slice(i);
|
|
25
|
-
const μL = left.reduce((a, b) => a + b, 0) / left.length;
|
|
26
|
-
const μR = right.reduce((a, b) => a + b, 0) / right.length;
|
|
27
|
-
const score = Math.abs(μL - μR);
|
|
28
|
-
if (score > best) {
|
|
29
|
-
best = score;
|
|
30
|
-
bestIdx = i;
|
|
31
|
-
}
|
|
75
|
+
if (!y.every(Number.isFinite)) {
|
|
76
|
+
return { index: null, score: 0, ...none, abstained: true, reason: 'series has a non-finite value' };
|
|
32
77
|
}
|
|
33
|
-
|
|
34
|
-
|
|
78
|
+
const { best, bestIdx } = welchScan(y);
|
|
79
|
+
const left = y.slice(0, bestIdx);
|
|
80
|
+
const right = y.slice(bestIdx);
|
|
81
|
+
const welch = studentTTest([...left], [...right]);
|
|
82
|
+
const num = (v) => (typeof v === 'number' && !Number.isNaN(v) ? v : null);
|
|
83
|
+
const perm = permutationTest([...left], [...right], maxWelch, { resamples, seed });
|
|
84
|
+
const pPermutation = num(perm.pValue);
|
|
85
|
+
if (pPermutation === null) {
|
|
86
|
+
return { index: null, score: best, ...none, abstained: true, reason: 'the permutation null did not return a p-value' };
|
|
35
87
|
}
|
|
36
|
-
|
|
88
|
+
const tests = {
|
|
89
|
+
meanDifference: meanOf(right) - meanOf(left),
|
|
90
|
+
tStatistic: num(welch.statistic),
|
|
91
|
+
degreesOfFreedom: num(welch.degreesOfFreedom),
|
|
92
|
+
pWelch: num(welch.pValue),
|
|
93
|
+
pPermutation,
|
|
94
|
+
};
|
|
95
|
+
if (pPermutation >= alpha) {
|
|
96
|
+
return {
|
|
97
|
+
index: null,
|
|
98
|
+
score: best,
|
|
99
|
+
...tests,
|
|
100
|
+
abstained: true,
|
|
101
|
+
reason: `no changepoint: permutation p = ${pPermutation.toPrecision(3)} ≥ α = ${alpha} for the maximum |Welch t| = ${best.toPrecision(3)} over ${y.length - 2 * MIN_SEGMENT + 1} splits`,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
return { index: bestIdx, score: best, ...tests, abstained: false };
|
|
37
105
|
}
|
|
38
106
|
/**
|
|
39
|
-
* Ordinary-least-squares log-log slope
|
|
107
|
+
* Ordinary-least-squares log-log slope, MathTS `linearRegression` on the
|
|
108
|
+
* logs, with its standard error. The p-value is NOT the one MathTS reports
|
|
109
|
+
* (`2·(1 − CDF)`, which rounds a far tail to 0): it is the direct t tail from
|
|
110
|
+
* `betainc`. Abstains if x or y are non-positive, or when the log-x spread
|
|
111
|
+
* (core `sumSquaredDeviations`, times n: the normal-equation denominator)
|
|
112
|
+
* is degenerate.
|
|
40
113
|
*
|
|
41
114
|
* @internal
|
|
42
115
|
*/
|
|
@@ -45,49 +118,50 @@ export function estimateScaleExponent(input) {
|
|
|
45
118
|
.map((x, i) => [x, input.y[i]])
|
|
46
119
|
.filter(([x, y]) => x > 0 && y > 0);
|
|
47
120
|
if (pairs.length < 3) {
|
|
48
|
-
return { exponent: null, abstained: true, reason: 'need ≥3 positive (x,y) pairs' };
|
|
49
|
-
}
|
|
50
|
-
const n = pairs.length;
|
|
51
|
-
let sX = 0;
|
|
52
|
-
let sY = 0;
|
|
53
|
-
let sXX = 0;
|
|
54
|
-
let sXY = 0;
|
|
55
|
-
for (const [x, y] of pairs) {
|
|
56
|
-
const lx = Math.log(x);
|
|
57
|
-
const ly = Math.log(y);
|
|
58
|
-
sX += lx;
|
|
59
|
-
sY += ly;
|
|
60
|
-
sXX += lx * lx;
|
|
61
|
-
sXY += lx * ly;
|
|
121
|
+
return { exponent: null, stdErr: null, pValue: null, n: pairs.length, abstained: true, reason: 'need ≥3 positive (x,y) pairs' };
|
|
62
122
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
123
|
+
const lx = pairs.map(([x]) => Math.log(x));
|
|
124
|
+
const ly = pairs.map(([, y]) => Math.log(y));
|
|
125
|
+
if (pairs.length * sumSquaredDeviations(lx) < 1e-18) {
|
|
126
|
+
return { exponent: null, stdErr: null, pValue: null, n: pairs.length, abstained: true, reason: 'degenerate log-x variance' };
|
|
66
127
|
}
|
|
67
|
-
|
|
128
|
+
const fit = linearRegression(lx, ly);
|
|
129
|
+
const df = pairs.length - 2;
|
|
130
|
+
const pValue = fit.stdErr > 0 ? studentTwoSidedP(fit.slope / fit.stdErr, df) : fit.slope === 0 ? 1 : 0;
|
|
131
|
+
return { exponent: fit.slope, stdErr: fit.stdErr, pValue, n: pairs.length, abstained: false };
|
|
68
132
|
}
|
|
69
133
|
/**
|
|
70
|
-
*
|
|
134
|
+
* Conservation probe as a test: q is conserved when the linear drift
|
|
135
|
+
* `slope` of `linearRegression(t, q)` satisfies |slope| ≤ k·stdErr. The
|
|
136
|
+
* standard error comes from the residual scatter of the same series, so the
|
|
137
|
+
* verdict is scale-free. k = 3 by default: a drift within three standard
|
|
138
|
+
* errors is not distinguishable from none at the series' own noise (a
|
|
139
|
+
* two-sided 0.27% under Gaussian residuals), the usual working threshold
|
|
140
|
+
* for "no effect seen". The test sees a linear drift only; a quantity that
|
|
141
|
+
* oscillates without drifting passes. The mean |dq/dt| is reported beside
|
|
142
|
+
* the verdict from MathTS `gradient` (second order inside the series), not
|
|
143
|
+
* from first-order forward differences, and never decides it. Abstains below
|
|
144
|
+
* three samples or when t is not strictly increasing.
|
|
71
145
|
*
|
|
72
146
|
* @internal
|
|
73
147
|
*/
|
|
74
|
-
export function probeConservation(q, t,
|
|
75
|
-
|
|
76
|
-
|
|
148
|
+
export function probeConservation(q, t, opts = {}) {
|
|
149
|
+
const k = opts.k ?? 3;
|
|
150
|
+
const none = { slope: null, stdErr: null, k };
|
|
151
|
+
if (q.length !== t.length || q.length < 3) {
|
|
152
|
+
return { conserved: false, meanAbsRate: NaN, ...none, abstained: true, reason: 'need ≥3 samples' };
|
|
77
153
|
}
|
|
78
|
-
let
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (dt === 0)
|
|
83
|
-
continue;
|
|
84
|
-
acc += Math.abs((q[i] - q[i - 1]) / dt);
|
|
85
|
-
n += 1;
|
|
154
|
+
for (let i = 1; i < t.length; i++) {
|
|
155
|
+
if (!(t[i] > t[i - 1])) {
|
|
156
|
+
return { conserved: false, meanAbsRate: NaN, ...none, abstained: true, reason: 'zero or negative Δt: t must increase strictly' };
|
|
157
|
+
}
|
|
86
158
|
}
|
|
87
|
-
|
|
88
|
-
|
|
159
|
+
const rate = gradient([...q], [...t]);
|
|
160
|
+
const meanAbsRate = pairwiseSum(rate.map(Math.abs)) / rate.length;
|
|
161
|
+
const fit = linearRegression([...t], [...q]);
|
|
162
|
+
if (!Number.isFinite(fit.slope) || !Number.isFinite(fit.stdErr)) {
|
|
163
|
+
return { conserved: false, meanAbsRate, ...none, abstained: true, reason: 'the drift fit is not finite' };
|
|
89
164
|
}
|
|
90
|
-
|
|
91
|
-
return { conserved: meanAbsRate <= atol, meanAbsRate, abstained: false };
|
|
165
|
+
return { conserved: Math.abs(fit.slope) <= k * fit.stdErr, meanAbsRate, slope: fit.slope, stdErr: fit.stdErr, k, abstained: false };
|
|
92
166
|
}
|
|
93
167
|
//# sourceMappingURL=structure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"structure.js","sourceRoot":"","sources":["../../../src/composition/probe/structure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAuB,EACvB,QAAQ,GAAG,GAAG;IAEd,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,KAAK,CAAC;IACvB,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;IAChF,CAAC;IACD,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC3B,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACzD,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CA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GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;IAClE,MAAM,GAAG,GAAG,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC7C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAChE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,6BAA6B,EAAE,CAAC;IAC5G,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACtI,CAAC","sourcesContent":["/**\n * Cheap structure probes as TESTS: a regime changepoint, a scale symmetry, a\n * conserved dQ/dt. Each verdict is scale-free: the same series scaled by 1e6\n * or by 1e-6 gets the same answer, because every threshold is in units of\n * the series' own scatter, never in the units of y.\n *\n * Task-0 style: recover a synthetic signal or honestly abstain. Never flips\n * `axes.ts` `gated`.\n *\n * @internal\n */\n\nimport { pairwiseSum, sumSquaredDeviations } from '@danielsimonjr/mathts-core';\nimport { gradient, linearRegression, permutationTest, studentTTest } from '@danielsimonjr/mathts-functions';\nimport { meanOf } from '../../numerical/statistics.js';\nimport { studentTwoSidedP } from './t-tail.js';\n\n/** A series sampled at `x` with values `y`, scanned for a step in its mean. @internal */\nexport interface ChangepointInput {\n readonly x: readonly number[];\n readonly y: readonly number[];\n /** Significance level of the permutation test; default 0.01. */\n readonly alpha?: number;\n /** Permutation resamples of the null; default 999. */\n readonly resamples?: number;\n /** Seed of the permutation null (MathTS `permutationTest`); default 20261015, never the clock. */\n readonly seed?: number;\n}\n\n/** The best split of {@link detectMeanChangepoint}, its tests, or an abstention with its reason. @internal */\nexport interface ChangepointResult {\n /** The split index (the right segment starts here) when the step is significant; null otherwise. */\n readonly index: number | null;\n /** |Welch t| at the best split: the step in units of its own standard error (scale-free). */\n readonly score: number;\n /** μ_right − μ_left at the best split, in the units of y; null when nothing was scanned. */\n readonly meanDifference: number | null;\n /** MathTS `studentTTest` at the best split: the Welch t and its degrees of freedom. */\n readonly tStatistic: number | null;\n readonly degreesOfFreedom: number | null;\n /**\n * The direct two-sided Welch p at the best split (one split, as if chosen in advance; not\n * corrected for the scan over splits, which is what `pPermutation` is for).\n */\n readonly pWelch: number | null;\n /** P(max over splits of |t| ≥ observed) under a seeded permutation of the series. */\n readonly pPermutation: number | null;\n readonly abstained: boolean;\n readonly reason?: string;\n}\n\n/** The smallest segment a split may leave on either side. */\nconst MIN_SEGMENT = 2;\n\n/**\n * |Welch t| at every admissible split of a series, from centred prefix sums:\n * O(n) for the scan the permutation null repeats. Two segments with no\n * scatter and different means give +Infinity; equal means give 0.\n */\nfunction welchScan(y: readonly number[]): { best: number; bestIdx: number } {\n const n = y.length;\n const mean = meanOf(y);\n const c = y.map((v) => v - mean);\n const s1 = new Float64Array(n + 1);\n const s2 = new Float64Array(n + 1);\n for (let i = 0; i < n; i++) {\n s1[i + 1] = s1[i]! + c[i]!;\n s2[i + 1] = s2[i]! + c[i]! * c[i]!;\n }\n let best = -1;\n let bestIdx = MIN_SEGMENT;\n for (let i = MIN_SEGMENT; i <= n - MIN_SEGMENT; i++) {\n const nL = i;\n const nR = n - i;\n const mL = s1[i]! / nL;\n const mR = (s1[n]! - s1[i]!) / nR;\n const vL = Math.max(0, s2[i]! - nL * mL * mL) / (nL - 1);\n const vR = Math.max(0, s2[n]! - s2[i]! - nR * mR * mR) / (nR - 1);\n const se = Math.sqrt(vL / nL + vR / nR);\n const d = Math.abs(mL - mR);\n const t = se > 0 ? d / se : d > 0 ? Number.POSITIVE_INFINITY : 0;\n if (t > best) {\n best = t;\n bestIdx = i;\n }\n }\n return { best, bestIdx };\n}\n\n/** The max-|t| statistic of a permuted series, in the two-sample form `permutationTest` shuffles. */\nconst maxWelch = (a: number[], b: number[]): number => welchScan([...a, ...b]).best;\n\n/**\n * Two-mean changepoint as a test. The best split maximises Welch's t over\n * the splits that leave at least two samples on each side; MathTS\n * `studentTTest` gives the t, the degrees of freedom and the direct p at that\n * split. Because the split was CHOSEN by the scan, that p is not the test:\n * the verdict is the seeded permutation null (MathTS `permutationTest`) of\n * the maximum over splits, flagged when `pPermutation < alpha` (default\n * 0.01). Every quantity is in units of the series' scatter, so a series and\n * its copy scaled by any factor get one verdict. Abstains below six samples.\n *\n * @internal\n */\nexport function detectMeanChangepoint(input: ChangepointInput): ChangepointResult {\n const { x, y } = input;\n const alpha = input.alpha ?? 0.01;\n const resamples = input.resamples ?? 999;\n const seed = input.seed ?? 20261015;\n const none = { meanDifference: null, tStatistic: null, degreesOfFreedom: null, pWelch: null, pPermutation: null };\n if (x.length !== y.length || x.length < 6) {\n return { index: null, score: 0, ...none, abstained: true, reason: 'series too short' };\n }\n if (!y.every(Number.isFinite)) {\n return { index: null, score: 0, ...none, abstained: true, reason: 'series has a non-finite value' };\n }\n const { best, bestIdx } = welchScan(y);\n const left = y.slice(0, bestIdx);\n const right = y.slice(bestIdx);\n const welch = studentTTest([...left], [...right]);\n const num = (v: unknown): number | null => (typeof v === 'number' && !Number.isNaN(v) ? v : null);\n const perm = permutationTest([...left], [...right], maxWelch, { resamples, seed });\n const pPermutation = num(perm.pValue);\n if (pPermutation === null) {\n return { index: null, score: best, ...none, abstained: true, reason: 'the permutation null did not return a p-value' };\n }\n const tests = {\n meanDifference: meanOf(right) - meanOf(left),\n tStatistic: num(welch.statistic),\n degreesOfFreedom: num(welch.degreesOfFreedom),\n pWelch: num(welch.pValue),\n pPermutation,\n };\n if (pPermutation >= alpha) {\n return {\n index: null,\n score: best,\n ...tests,\n abstained: true,\n reason: `no changepoint: permutation p = ${pPermutation.toPrecision(3)} ≥ α = ${alpha} for the maximum |Welch t| = ${best.toPrecision(3)} over ${y.length - 2 * MIN_SEGMENT + 1} splits`,\n };\n }\n return { index: bestIdx, score: best, ...tests, abstained: false };\n}\n\n/** Positive samples `(x, y)` whose log-log slope is the scale exponent. @internal */\nexport interface ScaleSymmetryInput {\n readonly x: readonly number[];\n readonly y: readonly number[];\n}\n\n/** The log-log slope with its standard error and the direct two-sided p of slope = 0. @internal */\nexport interface ScaleExponentResult {\n readonly exponent: number | null;\n /** Standard error of the slope (MathTS `linearRegression.stdErr`). */\n readonly stdErr: number | null;\n /** P(|T_{n−2}| ≥ |exponent/stdErr|), the direct tail ({@link studentTwoSidedP}); null below n = 3. */\n readonly pValue: number | null;\n /** The positive pairs the fit used. */\n readonly n: number;\n readonly abstained: boolean;\n readonly reason?: string;\n}\n\n/**\n * Ordinary-least-squares log-log slope, MathTS `linearRegression` on the\n * logs, with its standard error. The p-value is NOT the one MathTS reports\n * (`2·(1 − CDF)`, which rounds a far tail to 0): it is the direct t tail from\n * `betainc`. Abstains if x or y are non-positive, or when the log-x spread\n * (core `sumSquaredDeviations`, times n: the normal-equation denominator)\n * is degenerate.\n *\n * @internal\n */\nexport function estimateScaleExponent(input: ScaleSymmetryInput): ScaleExponentResult {\n const pairs = input.x\n .map((x, i) => [x, input.y[i]!] as const)\n .filter(([x, y]) => x > 0 && y > 0);\n if (pairs.length < 3) {\n return { exponent: null, stdErr: null, pValue: null, n: pairs.length, abstained: true, reason: 'need ≥3 positive (x,y) pairs' };\n }\n const lx = pairs.map(([x]) => Math.log(x));\n const ly = pairs.map(([, y]) => Math.log(y));\n if (pairs.length * sumSquaredDeviations(lx) < 1e-18) {\n return { exponent: null, stdErr: null, pValue: null, n: pairs.length, abstained: true, reason: 'degenerate log-x variance' };\n }\n const fit = linearRegression(lx, ly);\n const df = pairs.length - 2;\n const pValue = fit.stdErr > 0 ? studentTwoSidedP(fit.slope / fit.stdErr, df) : fit.slope === 0 ? 1 : 0;\n return { exponent: fit.slope, stdErr: fit.stdErr, pValue, n: pairs.length, abstained: false };\n}\n\n/** The verdict of {@link probeConservation}: no drift in q beyond k standard errors of its slope. @internal */\nexport interface ConservationResult {\n readonly conserved: boolean;\n /** Mean |dq/dt| from MathTS `gradient` (second-order central differences inside, one-sided at the ends). */\n readonly meanAbsRate: number;\n /** The slope of MathTS `linearRegression(t, q)` and its standard error. */\n readonly slope: number | null;\n readonly stdErr: number | null;\n /** The multiple of the standard error a drift must exceed to count. */\n readonly k: number;\n readonly abstained: boolean;\n readonly reason?: string;\n}\n\n/**\n * Conservation probe as a test: q is conserved when the linear drift\n * `slope` of `linearRegression(t, q)` satisfies |slope| ≤ k·stdErr. The\n * standard error comes from the residual scatter of the same series, so the\n * verdict is scale-free. k = 3 by default: a drift within three standard\n * errors is not distinguishable from none at the series' own noise (a\n * two-sided 0.27% under Gaussian residuals), the usual working threshold\n * for \"no effect seen\". The test sees a linear drift only; a quantity that\n * oscillates without drifting passes. The mean |dq/dt| is reported beside\n * the verdict from MathTS `gradient` (second order inside the series), not\n * from first-order forward differences, and never decides it. Abstains below\n * three samples or when t is not strictly increasing.\n *\n * @internal\n */\nexport function probeConservation(\n q: readonly number[],\n t: readonly number[],\n opts: { readonly k?: number } = {},\n): ConservationResult {\n const k = opts.k ?? 3;\n const none = { slope: null, stdErr: null, k };\n if (q.length !== t.length || q.length < 3) {\n return { conserved: false, meanAbsRate: NaN, ...none, abstained: true, reason: 'need ≥3 samples' };\n }\n for (let i = 1; i < t.length; i++) {\n if (!(t[i]! > t[i - 1]!)) {\n return { conserved: false, meanAbsRate: NaN, ...none, abstained: true, reason: 'zero or negative Δt: t must increase strictly' };\n }\n }\n const rate = gradient([...q], [...t]);\n const meanAbsRate = pairwiseSum(rate.map(Math.abs)) / rate.length;\n const fit = linearRegression([...t], [...q]);\n if (!Number.isFinite(fit.slope) || !Number.isFinite(fit.stdErr)) {\n return { conserved: false, meanAbsRate, ...none, abstained: true, reason: 'the drift fit is not finite' };\n }\n return { conserved: Math.abs(fit.slope) <= k * fit.stdErr, meanAbsRate, slope: fit.slope, stdErr: fit.stdErr, k, abstained: false };\n}\n"]}
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
29
29
|
import { type Dimension } from '../../dimensional/types.js';
|
|
30
|
-
import type { ExprNode } from '../../dimensional/ast-types.js';
|
|
31
30
|
import type { SearchBudget, SearchStopReason } from './types.js';
|
|
32
31
|
/** The partition a study row belongs to for fitting, holdout testing or replication. @internal */
|
|
33
32
|
export type StudyRole = 'exploratory' | 'holdout' | 'replication';
|
|
@@ -63,6 +62,12 @@ export interface StudyObservation {
|
|
|
63
62
|
export interface StudyCorrection {
|
|
64
63
|
readonly input: string;
|
|
65
64
|
readonly powers: readonly number[];
|
|
65
|
+
/**
|
|
66
|
+
* A reference value the file declares for a power's coefficient (keyed by the power's text,
|
|
67
|
+
* e.g. `{"2": 0.0625}` for the pendulum series θ²/16): the fitted coefficient's z against it
|
|
68
|
+
* is reported, and decides nothing.
|
|
69
|
+
*/
|
|
70
|
+
readonly reference?: Readonly<Record<string, number>>;
|
|
66
71
|
}
|
|
67
72
|
/** A declared comparison model formula and whether its scale is fit on exploratory rows. @internal */
|
|
68
73
|
export interface StudyBaseline {
|
|
@@ -101,6 +106,10 @@ export interface ProbeStudy {
|
|
|
101
106
|
export declare class StudyRefusal extends Error {
|
|
102
107
|
constructor(message: string);
|
|
103
108
|
}
|
|
109
|
+
/** The χ² test level a study file states none of. @internal */
|
|
110
|
+
export declare const DEFAULT_ALPHA = 0.001;
|
|
111
|
+
/** How many powers a study file's correction may list in all. @internal */
|
|
112
|
+
export declare const MAX_CORRECTION_TERMS = 6;
|
|
104
113
|
/** Parse and validate a study file. Throws {@link StudyRefusal}. @internal */
|
|
105
114
|
export declare function parseStudy(raw: unknown, source?: string): ProbeStudy;
|
|
106
115
|
/** Load a study JSON file. @internal */
|
|
@@ -178,8 +187,8 @@ export declare function studyCsvToRaw(text: string, source?: string): Record<str
|
|
|
178
187
|
/** P(χ²_ν ≥ chi2): the probability of a χ² at least this large if the model and σ are right. @internal */
|
|
179
188
|
export declare function chiSquareSurvival(chi2: number, dof: number): number;
|
|
180
189
|
/**
|
|
181
|
-
* P(χ²_ν ≤ chi2), computed directly in the lower tail
|
|
182
|
-
* round a small probability away. @internal
|
|
190
|
+
* P(χ²_ν ≤ chi2), computed directly in the lower tail (MathTS `gammainc` is
|
|
191
|
+
* the series there), where 1 − Q would round a small probability away. @internal
|
|
183
192
|
*/
|
|
184
193
|
export declare function chiSquareCdf(chi2: number, dof: number): number;
|
|
185
194
|
/** P(F_{d1,d2} ≥ f): the probability of an F ratio at least this large if the extra terms explain nothing. @internal */
|
|
@@ -204,6 +213,8 @@ export interface ModelTest {
|
|
|
204
213
|
readonly fittedParameters: number;
|
|
205
214
|
/** SI coherent; 1 for a fixed baseline, the level for the null model. */
|
|
206
215
|
readonly prefactor: number | null;
|
|
216
|
+
/** Standard error of the prefactor from (ΦᵀWΦ)⁻¹ with the declared σ; null when unfit or fixed. */
|
|
217
|
+
readonly prefactorStderr: number | null;
|
|
207
218
|
readonly exploratory: SetTest | null;
|
|
208
219
|
readonly holdout: SetTest | null;
|
|
209
220
|
readonly replication: SetTest | null;
|
|
@@ -212,8 +223,14 @@ export interface ModelTest {
|
|
|
212
223
|
type Predictor = (inputs: Readonly<Record<string, number>>) => number;
|
|
213
224
|
/**
|
|
214
225
|
* The effective σ of one row under a model f: σ_eff² = σ_y² + Σ_i (∂f/∂x_i · σ_xi)²
|
|
215
|
-
* over the inputs with a σ,
|
|
216
|
-
*
|
|
226
|
+
* over the inputs with a σ, the GUM first-order propagation of MathTS
|
|
227
|
+
* `propagateUncertainty` (the one uncertainty path of the library, as in
|
|
228
|
+
* `composition/uncertainty.ts`), each partial a central difference with the
|
|
229
|
+
* relative step 1e-6·|x_i| at the recorded inputs. An input that is exactly
|
|
230
|
+
* zero has no relative step, so it is passed to MathTS shifted by
|
|
231
|
+
* c = 1e3·σ_xi and read back as z − c inside the model: the derivative is
|
|
232
|
+
* unchanged and the step is 1e-6·c = 1e-3·σ_xi, the floor the hand-coded
|
|
233
|
+
* difference used before. First order in σ_x: exact for f linear in x_i.
|
|
217
234
|
*
|
|
218
235
|
* @internal
|
|
219
236
|
*/
|
|
@@ -229,8 +246,6 @@ export interface CorrectionStep {
|
|
|
229
246
|
readonly admitted: boolean;
|
|
230
247
|
readonly reason: string;
|
|
231
248
|
}
|
|
232
|
-
/** Infix rendering of a scalar ExprNode for reports. */
|
|
233
|
-
export declare function exprToInfix(e: ExprNode): string;
|
|
234
249
|
/** The main holdout verdict assigned after candidate selection. @internal */
|
|
235
250
|
export type StudyVerdict = 'no-credible-candidate' | 'refuted-on-holdout' | 'survives-holdout' | 'untested-on-holdout';
|
|
236
251
|
/** The separate replication classification assigned after fitting and holdout handling. @internal */
|
|
@@ -242,13 +257,21 @@ export interface CandidateTest extends ModelTest {
|
|
|
242
257
|
/** Set on a candidate from the declared correction families: m(x)·(1 + Σ c_k·u_k^p_k). */
|
|
243
258
|
readonly correction?: {
|
|
244
259
|
readonly base: string;
|
|
245
|
-
readonly terms: readonly
|
|
246
|
-
readonly input: string;
|
|
247
|
-
readonly power: number;
|
|
248
|
-
readonly coefficient: number;
|
|
249
|
-
}[];
|
|
260
|
+
readonly terms: readonly CorrectionCoefficient[];
|
|
250
261
|
};
|
|
251
262
|
}
|
|
263
|
+
/** One fitted correction coefficient c_k = a_k/a_0, with its standard error and, when the file declared one, the reference it is compared with. @internal */
|
|
264
|
+
export interface CorrectionCoefficient {
|
|
265
|
+
readonly input: string;
|
|
266
|
+
readonly power: number;
|
|
267
|
+
readonly coefficient: number;
|
|
268
|
+
/** Delta-method standard error of a_k/a_0 from the fit's covariance; null when the inverse failed. */
|
|
269
|
+
readonly stderr: number | null;
|
|
270
|
+
/** The declared reference value, when the family states one for this power. */
|
|
271
|
+
readonly reference?: number;
|
|
272
|
+
/** (coefficient − reference)/stderr; present when both are. Reported, never a verdict. */
|
|
273
|
+
readonly z?: number;
|
|
274
|
+
}
|
|
252
275
|
/** How the declared correction families were searched. @internal */
|
|
253
276
|
export interface StudyCorrectionReport {
|
|
254
277
|
readonly families: readonly StudyCorrection[];
|