Worked Examples
Validate scientifically temporal indicator trends — Global Impact Catalyst
Validate Global Impact Catalyst temporal indicator trends through controlled tests of observation revisions, calendar spacing, source and method versions, missing data, and population comparability. This source-reviewed scientific validation guide provides reproducible diagnostics, read-only repository reconciliation, and publication acceptance criteria that distinguish deterministic trend calculations from defensible longitudinal evidence.
Application: Global Impact Catalyst
Component: Measurement Repository / Analysis Repository / Indicator Registry / Evidence Chain / Reporting Studio
Source baseline: v2.0.0 platform; v1.1.0 canonical contract; v1.3.0 evidence; v1.4.0 indicator registry; v1.5.0 measurement; v1.7.0 analysis; v1.8.0 reporting
Article type: Scientific Validation / Developer Reference
Estimated reading time: 23–28 minutes
Verification status: Source reviewed and synthetic controls tested; staging and deployed-system acceptance pending.
1. Goal
Determine whether a temporal indicator trend accurately summarizes comparable observations across a documented time window and whether the chart preserves a reviewable lineage to the source versions, indicator definition, method, transformations, exclusions, revisions, and publication snapshot. The primary acceptance criterion is not merely that a line chart renders, but that a qualified reviewer can reproduce every included point and identify every methodological discontinuity.
Primary criterion: Trend charts record source versions and changes in methodology. A passing numeric trend calculation must not be presented as causal impact, forecast accuracy, or scientific assurance. Those conclusions require separate design and evidence.
2. Requirements
Use an authorized staging copy, or fictional observations whose units, periods, and identifiers are deliberately explicit. Identify the initiative, workspace, indicator ID, population and geography; intended observation cadence; definition and unit; source versions; method versions; saved revision; chart audience; and publishing authority before running acceptance tests. Preserve restricted supporting evidence in the authorized workspace rather than attaching it to a public issue.
Implementation prerequisites are Python 3.10+ for the companion standard-library checker. The repository-native probe requires an existing Global Impact Catalyst checkout with its documented Python dependencies; database audits require authorized read-only access to SQLite schema 6 or later. No production write operation is necessary for the tests described here.
3. Study design and decision boundaries
Define the estimand before choosing a chart: change between two observations, annual rate of change, a within-period average, a rate per eligible participant, or a difference from a comparator. Each is a different estimand. For annual trend reporting, predeclare the years, expected number of periods, completeness threshold, period aggregation, and what constitutes a revised data release. A change in denominator or target population can create an apparent trend even when the underlying phenomenon has not changed.
Set an analysis protocol version and register exclusions before inspecting the result. Include measurement uncertainty, clustering, seasonality, autocorrelation, external events, changes in instrument or classification, and missingness mechanisms when scientifically relevant. The repo implements structured trend summaries; it does not automatically establish a causal study design or fit a statistical time-series model with inferential confidence intervals.
4. Repository map and implementation boundary
| Verified source | Implemented responsibility | Not established by this alone |
|---|---|---|
python/global_impact_measurement.py |
Time-indexed observations, states, revised-record references, effective series | Population and denominator comparability |
python/global_impact_analysis.py |
analyze_trend(), exclusions, unit conversion, deterministic statistics, optional persisted runs |
Elapsed-time regression or causal inference |
python/global_impact_registry.py |
Versioned indicator and method definitions, governed units | Automatic cross-version harmonization |
python/global_impact_repository.py |
Sources, source versions, evidence chains, revisions, repository audits | Authenticity or scientific adequacy of captured evidence |
python/global_impact_reporting.py |
Trend dashboard cards, publication snapshots, reproducible exports | Chart-level provenance completeness without further checks |
Source code: analysis module, measurement module, and analysis documentation.
5. Canonical identity and temporal contract
An observation in the persisted v1.5.0 measurement repository has observation_record_id, workspace_id, initiative_id, indicator_id, optional indicator_definition_id, period_start, period_end, period_label, value, unit_id, data_state, optional revision_of_observation_id, source_id, method_definition_id, aggregate dimensions_json, and denominator_json. These are actual columns in migrations/006_observations_beneficiaries_budgets_outcome_portfolios.sql.
Important distinction: an observation references source and method definitions, but does not have dedicated columns for immutable source_version_id or method_definition_version_id. The broader evidence repository and indicator registry do support version records and bindings. The required association between an observation, the exact source payload version, the method version used, and a published chart therefore needs an independently verifiable lineage manifest or repository relationship. Do not invent those columns in production migrations.
6. Data-state handling and missingness
The code recognizes complete, missing, late, revised, and partial. A missing record has no numeric value. analyze_trend() removes missing observations and supports missing_policy=block|exclude|warn; include_partial=False excludes partial records with a warning. Late records with values can enter the included series. An eligible plotted point is not equivalent to a validated scientific observation.
Prespecify why records are late, missing, or partial. Report the expected number of periods and completeness rate, including records absent entirely from the database. An absent year is not automatically the same as a stored record marked missing, and neither zero imputation nor interpolation should be silently performed.
7. Revision chains and effective observations
The repository exposes observation_time_series() and applies _effective_records(), which removes any record referenced as the predecessor of another record. Revised records must name their preceding observation, and the recording function checks that the predecessor exists for the same initiative and indicator. Source inspection does not establish a single-chain policy preventing two different revisions of the same predecessor; it also does not imply that the revised value is methodologically comparable to the original.
Validation should test a normal revision, a missing predecessor, two competing revisions, a cyclic link, a revised period boundary, and a latest revision with a different method. Retain the entire chain in restricted evidence and display only the effective period values publicly. Where the current schema admits ambiguous competing revisions, hold the trend pending a documented choice rather than arbitrarily counting both.
8. Source version integrity
The v1.3.0 evidence repository stores source records separately from immutable source versions, including SHA-256 digests, version labels, capture time, and capture actor. A matching digest supports byte-level integrity, not truth, accuracy, ownership, or legal permission. A trend acceptance packet should resolve each plotted observation through its source_id to a specific source_version_id, checksum, retrieval locator, transformation script, and approval decision.
Test a changed source with the same title, a duplicate checksum, a missing version, an inaccessible link, a license restriction, and an intentionally corrupted payload. Confirm that a source version changing after chart publication either causes a new reviewed chart revision or leaves the already-published immutable snapshot unchanged and correctly labeled.
9. Indicator and method-version integrity
GIC v1.4.0 implements versioned indicator definitions, methods, baseline models, and targets, with bindings to immutable version IDs. The time-series trend method itself filters by initiative and indicator but does not reject a mixed set of indicator_definition_id or method_definition_id values before calculating the trend. It also does not automatically verify that historical observations used identical population definitions or denominator rules.
Resolve the active registry binding, compare each year’s actual definitions, and document transition or bridging methods. A new instrument, classification code, sampling frame, inflation deflator, geospatial boundary, denominator, or survey question can change the measurement meaning. If no justified crosswalk exists, split the trend into separately labeled segments; do not use a continuous unqualified line.
10. Unit and denominator reconciliation
analyze_trend() attempts governed unit conversion into target_unit_id and records a blocker plus exclusion if conversion fails. This does not convert incompatible substantive definitions, such as total people versus people per 1,000 residents, or stock versus flow. Predeclare a canonical unit and numerical precision, then check sign, direction, denominator, period coverage, and aggregation policy. Preserve original observed values and transformed chart values separately.
For rates r_t = N_t / D_t, both numerator N_t and denominator D_t must represent the same defined population and interval. When denominator construction changes, retain the old and new definitions and review the historical series for comparability. Do not interpret rising counts as improved outcomes when exposure or eligibility has expanded.
11. Temporal spacing and the source-implemented slope
Critical implementation detail: the source _slope(values) function calculates an ordinary least-squares slope against observation indices 0,1,2,…, not elapsed time. For equally spaced observations this is a change per included point. When intervals differ, the statistic is not a rate per calendar year.
For a true time-normalized descriptive slope, use β = Σ(tᵢ − t̄)(yᵢ − ȳ) / Σ(tᵢ − t̄)² with a documented time axis. The following synthetic annual observations illustrate the difference.
| Year | Value | Difference from prior value |
|---|---|---|
| 2020 | 100 | — |
| 2021 | 104 | +4 |
| 2024 | 116 | +12 across three years |
The observed endpoint change is 16 units. GIC’s index-based slope is 8 units per included observation. Regression against calendar years gives 4 units per year. Neither slope establishes intervention effects. The irregular interval must remain visible in any chart axis and methodology note.
years = [2020, 2021, 2024]
values = [100.0, 104.0, 116.0]
def ols_slope(xs, ys):
xm, ym = sum(xs)/len(xs), sum(ys)/len(ys)
return sum((x-xm)*(y-ym) for x,y in zip(xs,ys)) / sum((x-xm)**2 for x in xs)
print("per-observation slope:", ols_slope([0,1,2], values))
print("per-calendar-year slope:", ols_slope(years, values))
# Expected: 8.0 and 4.0
12. Endpoints, percentage change, and small samples
The code reports first and last values, absolute change, percent change, minimum, maximum, and arithmetic mean. Percentage change divides by the absolute first value and returns null if it is zero. The integrity.valid flag is true if no blockers exist and at least one usable value remains; for fewer than two values, a warning is produced. A one-point series must not be interpreted as an empirically demonstrated temporal direction.
Define separate acceptance rules: at least two observations for a change, at least three for a rudimentary slope, and more data plus a justified uncertainty model for inferential claims. For a zero or near-zero baseline, publish absolute differences or a separately specified metric; do not display an infinite or misleading growth percentage.
13. Temporal confounders and interpretation
Seasonality, changes in program coverage, economic conditions, weather events, migration, regulatory changes, survey response rates, and instrument upgrades may create or mask apparent trends. Register material external factors and methods and describe whether they affect level, slope, missingness, or sampling. The measurement repository supports external-factor and contribution-note records, but the trend function does not use them to adjust the calculated slope automatically.
Use cautious language: “The recorded indicator increased over the selected periods” is descriptive. “The intervention caused an increase” requires an independently defensible identification design and relevant claim governance. A good chart cannot replace a counterfactual study or establish additionality.
14. Statistical reliability and uncertainty
A deterministic slope is not a confidence interval. Assess sampling design, number of periods, effective sample sizes, instrument calibration, autocorrelation, missingness, heteroskedasticity, measurement error, outliers, and changes in coverage. If confidence intervals are reported, state the model, assumptions, unit of analysis, and whether the intervals account for serial dependence. A short sequence of aggregate annual means may support descriptive reporting while being inadequate for formal significance claims.
Run sensitivity analyses with and without partial records, alternative missing-data handling, revised historical extracts, unit-conversion choices, and any methodological bridge. Identify decisions made after viewing results. Publish estimates with uncertainty and limitations, not just a single smoothed line.
15. Provenance and chart source manifest
Because trend output points contain observation ID, period, value, unit, state, and dimensions—but not source/method version IDs—a separate provenance manifest is required to meet the primary acceptance criterion. A proposed chart-level manifest should record: chart_id, analysis_run_id, indicator/definition/binding versions, source_version_id for every point, method_definition_version_id, checksum of each input, canonical unit, transformations, exclusions, review decision, code commit, and publication-snapshot hash.
This is a proposed validation artifact, not an existing v2.0.0 schema or REST route. Do not falsely label a custom manifest as the repository’s canonical contract. Link it externally or as governed evidence until a new versioned capability is approved.
16. Reproduce the offline scientific checker
The companion developer package includes a standard-library validator and two entirely fictional JSON snapshots. It checks scope, immutable version references, version hashes, revision ambiguity, missing periods, partial-data policy, context drift, chart lineage, publication hash state, and calendar spacing. This validator is independent of GIC; it is not a production API nor a substitute for repository-native tests.
python3 gic_temporal_trend_audit.py --input fixtures/clean.json --format text
python3 gic_temporal_trend_audit.py --input fixtures/adverse.json --format json
python3 -m unittest discover -s tests -v
Expected: clean exits with code 0 and no findings; adverse exits with code 2 and deliberately reported counterexamples. In an interactive shell, append || test $? -eq 2 only when explicitly expecting negative diagnostics.
17. Execute repository-native calculations
From an authorized local checkout of the pinned GitHub commit, the following commands exercise actual GIC code and official fixtures. They are not automatically run by merely downloading the article.
git checkout e75808a0aa272656b1fdbacd2491c30fd6b987dc
python3 -m pip install -r requirements-dev.txt
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python3 -m pytest -q tests/test_analysis_scenarios.py tests/test_measurement_portfolios.py tests/test_reporting_publication.py
PYTHONPATH=. python3 /path/to/repository_native_probe.py
Actual relevant functions are SQLiteImpactRepository.analyze_trend(initiative_id, indicator_id, target_unit_id=None, include_partial=False, missing_policy='exclude', persist=False) and observation_time_series(initiative_id, indicator_id). Run against synthetic or staging copies, not a mutable production database.
18. Read-only SQLite reconciliation
For authorized operators, read_only_sqlite_inventory.py opens an existing local SQLite file in read-only immutable mode, checks that schema 6 observation tables exist, and returns aggregates for the specified workspace, initiative, and indicator. It does not print numeric observations, source excerpts, or person-level records.
python3 read_only_sqlite_inventory.py \
--database /secure/path/to/authorized-copy.sqlite3 \
--workspace-id gic-workspace-EXAMPLE \
--initiative-id gic-initiative-EXAMPLE \
--indicator-id gic-indicator-EXAMPLE
Interpret counts carefully: a populated source_id does not mean a specific source-version checksum was attached, and one method-definition ID does not establish a single immutable method version. The inventory checks schema-level completeness only. Never post the underlying database file to a public issue.
19. Core positive and negative experiments
| Case | Method | Expected acceptance |
|---|---|---|
| Comparable annual series | Five complete fictional years, same method and denominator | Reproducible values and period labels; zero diagnostic findings |
| Nonuniform spacing | Remove intermediate years | Must not label index slope as “per year” |
| Revision replacement | Replace one period with a versioned revised observation | Exactly one effective value; predecessor retained for audit |
| Missing/partial data | Mark observation missing or partial | Policy, denominator, and exclusions disclosed |
| Method/indicator change | Change definition or collection protocol midseries | Document bridge or separate segments |
| Source integrity failure | Alter payload after checksum capture | Mismatch blocks unqualified publication |
| Cross-workspace record | Inject a different workspace or initiative ID | Reject from series; no unauthorized data disclosure |
| Publication drift | Modify source data after approved snapshot | Published chart remains bound to reviewed snapshot or is withheld |
20. Source, method, and denominators: minimum report table
A publication-ready reviewer packet should contain one row per period with the observed value and unit, source title and captured source version, method name and immutable version, population, geography, denominator definition, data state, revision identity, inclusion decision, conversion formula, and uncertainty note. If a data provider revised its series retrospectively, explicitly state whether the chart is an “as originally published” vintage or a “latest revised historical” vintage. Both can be useful; they answer different questions.
21. Publication and access governance
Global Impact Catalyst review workflow v1.6.0 requires an approval decision, adequate submitted quality assessment, no open corrections, and unchanged subject hash before publication. v1.8.0 snapshots bind evidence and analysis repository hashes. Public API v1.9.0 is designed to exclude drafts, withdrawn records, stale snapshots, source contents, and private reviewer information.
Test a draft trend card, approved current snapshot, superseded source, withdrawn publication, stale API cache, unauthorized workspace request, restricted evidence, and exported reproducible bundle. Verify the published trend remains interpretable when the underlying live observations change. Approval and checksum consistency establish procedural control, not scientific truth.
22. Validation criteria and decision rule
PASS requires correct unit and period treatment, unique effective observations, explicit missingness rules, reproducible calculation, a complete source-version and method-version trail, denominator/population compatibility, a calibrated uncertainty statement, a reviewed methodology-change decision, and publication access checks. FAIL applies to unauthorized disclosure, stale approved hashes, duplicate effective values, misrepresented annual slope, unresolved unit conflicts, or fabricated provenance. INDETERMINATE applies when adequate sampling, source authenticity, or external methodological evidence cannot be established.
For exploratory descriptive charts, publish with conspicuous limitations only after the appropriate reviewer decides that residual warnings are acceptable. For causal, additionality, or certification claims, require a separate protocol and independent review. Do not convert a numerical trend-integrity flag to a scientific-certification label.
23. Troubleshooting
If trend values differ from the source, first reconcile the exact indicator ID, period labels and dates, target unit, data-state policy, and revision pointers. Then inspect data coverage and source-version checksums; finally verify the renderer’s binding to the analysis run. If the slope is numerically correct but its units are wrong, examine observation spacing before investigating chart libraries.
If a chart changes after refresh, determine whether the effective observation changed, a source file was revised, a method registry binding changed, or a new analysis run was generated. Compare stored input_hash and result_hash from analysis_runs against the prior governed artifact, noting that the source function’s stored input_document contains run options rather than a complete observation manifest.
24. Resolution and safe recovery
Preserve the original revision and its approved publication snapshot. Correct invalid records in staging using the application service, with expected revisions to prevent stale updates. Where an observation is genuinely wrong, create a traceable revised observation rather than deleting contradictory historical evidence. Recompute with identical methods, then document differences from the old published series. Where definitions changed, create a versioned crosswalk or split the chart; do not mutate a historical method description to disguise a discontinuity.
Re-run synthetic negative controls and repository-native tests, submit updated methodological evidence to review, and create a new approved snapshot when warranted. If public material was exposed improperly, follow the institution’s incident response and withdrawal process; archive links and caches must be checked separately.
25. Verification and evidence packet
Attach the pinned Git commit, contract and repository versions, analysis run ID, relevant observation IDs, original/revised data-state counts, lineage manifest, source hashes, method hashes, uncertainty protocol, code/environment versions, reviewer decision, approved publication-snapshot hash, test results, and exact staging environment. Mark each check PASS, FAIL, NOT_RUN, or INDETERMINATE. The accompanying staging matrix starts at NOT_RUN; no production acceptance may be inferred from offline unit tests.
26. Reporting and scientific limitations
Reproducibility establishes that computations can be repeated from a stated dataset and method. It does not prove that data are unbiased, samples are representative, trends are real outside the observed period, or that an intervention caused the change. Avoid ecological inference from aggregate disaggregations, disclose uncertainty and conflicts of interest, and protect restricted research data. GIC’s deterministic trend engine should be presented as a descriptive analysis layer unless separate statistical, causal, and assurance processes have been completed.
27. Technical references
- Global Impact Catalyst v2.0.0 — pinned source repository.
- Analysis implementation —
analyze_trendand_slope. - Measurement implementation — revisions and
observation_time_series. - Versioned indicator and method registry.
- Dashboards, reporting, publication snapshots.
- Migration 006 — observation record columns; migration 008 — analysis runs.
- Official analysis tests; official measurement tests; official reporting tests.
End state: Treat every temporal chart as a versioned scientific assertion whose periods, measurement definitions, data vintages, transformations, uncertainty, exclusions, and review outcome can be independently reconstructed. Charts that cannot satisfy that standard must remain provisional or explicitly qualified.
