ShawnChamberlain's picture
Publish Mortgage Rate Lock-In research package
d8c288c verified
|
Raw
History Blame Contribute Delete
7.05 kB

Replication Protocol

How to reproduce every number, and what cannot be reproduced without registered data.

Generated 2026-08-13T17:12:55+00:00
Git commit 2dbe7119f97f-dirty
Config sample (digest 9fb71e2454f98608)
Data class SYNTHETIC
Data period 2021-01..2024-12
Artifacts used 1

⚠️ SYNTHETIC DATA. The loan-level numbers in this report were computed from synthetic fixtures generated for engineering tests (lockin.fixtures, seed recorded in the manifest). They are not empirical findings about U.S. mortgages — they recover the parameters of this repository's own data-generating process. The public aggregate series in this report (Freddie Mac PMMS, FHFA HPI, HMDA, Census Building Permits Survey) are real.

To produce empirical loan-level results, complete the registration in data/DATA_ACCESS.md §R1 and re-run. See AGENTS.md §1 and data/LICENSE_AND_REDISTRIBUTION.md §4.

1. Reproducing this run exactly

make setup
make fetch-public-data
make reproduce-sample
make test

make reproduce-sample executes, in order: prepare-sample-data, ingest-mortgages, build-loan-events, build-lockin, build-local-panel, validate-data, estimate-hazards, estimate-local-effects, benchmark, simulate-policy, report.

Determinism:

  • Synthetic fixtures are generated from mortgage.synthetic_seed (recorded in the fixture manifest).
  • Model seeds come from survival.seed.
  • Every artifact records git_commit, config_digest, data_period, source_versions (schema@retrieved#checksum per dataset), and a UTC timestamp.
  • Every dataset on disk has a manifest with a SHA-256 checksum; make validate-data re-checksums and fails on mismatch.

The one non-deterministic input is the public data vintage. PMMS, FHFA HPI, and Census BPS are revised; HMDA is re-released. A rerun weeks later will fetch newer vintages. The manifests record exactly which vintage was used, so a difference is diagnosable rather than mysterious.

2. What cannot be reproduced without registered data

Loan-level results in this run were computed from synthetic fixtures unless the artifact's data_class says REGISTERED. To reproduce them empirically:

  1. Register at the Freddie Mac Single-Family Loan-Level Dataset page and accept the terms of use yourself. This repository does not and will not bypass that wall, and the terms prohibit redistributing the records.
  2. Place the archives unmodified in data/raw/freddie/.
  3. Set mortgage.mode: registered_sample (or registered_full) and rerun.

The adapter discovers historical_data_YYYYQn.zip / sample_YYYY.zip automatically, reads members without full extraction, and the SYNTHETIC stamps and report banners disappear on their own. No code changes are needed — that is the point of the mode switch.

Public aggregate results (PMMS path, FHFA HPI growth, HMDA origination counts, Census permits) are fully reproducible now, because those sources need no registration.

3. Artifact-to-claim traceability

Every number in every generated report comes from a JSON artifact under outputs/. To trace one:

uv run lockin dump-artifact hazards dt_logit_prepayment

Each artifact carries evidence_tier, population, geography, outcome_definition, weight, caveats, and full provenance. A report sentence with no artifact behind it is a defect.

Reports are regenerated by make report and begin with a GENERATED header. Hand-editing them is a defect: the edit is destroyed on the next run and breaks traceability in the meantime.

4. Verification checklist for a reviewer

check command
schema matches the official layout uv run lockin verify-schema
all manifests checksum-clean make validate-data
market rates have no look-ahead make validate-data (rates section)
payment and rate-gap math make test (tests/test_amortization.py, tests/test_lockin_measures.py)
prepayment is not called mobility make test (tests/test_governance.py::test_no_mobility_language)
no restricted data is tracked by git make validate-data (governance section)
pipeline stage status uv run lockin status

5. Known non-reproducible or fragile steps

  • The FRED cross-check on PMMS is an optional network call and may time out; its failure is recorded and does not stop the pipeline.
  • Census BPS monthly files are fetched at the c (preliminary) vintage by default. Passing vintages_to_try=("r", "c") prefers revised where it exists, at the cost of one failed request per missing month.
  • The HMDA aggregations API is rate-sensitive; the adapter caches every cell and records which cells failed, so a partial fetch is visible rather than silently filled with zeros.

Artifacts this report was built from

artifact tier population weight
validation/validation_report descriptive all ingested tables and cached public series… n/a

Source versions

dataset schema@retrieved#checksum
active_mortgage_stock active-stock-v1@2026-08-13T09:32:43+00:00#f36e659e2b57
bls_laus bls-api-v2-laus-state-v1@2026-08-11T17:41:19+00:00#8cd9335cc5ae
census_bps census-bps-state-monthly-v1@2026-08-13T09:27:18+00:00#d3e4a46f74a5
fhfa_hpi fhfa-hpi-master-v1@2026-08-13T09:25:46+00:00#8ab042e042ff
freddie_llds_synthetic_fixtures freddie-llds-2026-08-10@2026-08-13T09:29:56+00:00#68da95265c31
hmda cfpb-data-browser-aggregations-v2@2026-08-13T09:27:18+00:00#6946b46cf136
loan_episodes loan-episodes-v1@2026-08-13T09:32:34+00:00#5e658b4c1b59
loan_events loan-events-v1@2026-08-13T09:30:24+00:00#aada815c333d
local_market_panel_annual local-panel-v1@2026-08-13T09:32:43+00:00#d56df8b8380b
local_market_panel_monthly local-panel-v1@2026-08-13T09:32:43+00:00#c6946b128163
omb_cbsa_crosswalk census-list1-v1@2026-08-13T09:27:19+00:00#222ea05e6b27
omb_cbsa_stability census-list1-v1@2026-08-13T09:27:19+00:00#30514ffa77ff
pmms pmms-history-v1@2026-08-13T09:25:46+00:00#c74cccece4a6
teleworkable_msa dingel-neiman-2020-v1@2026-08-13T09:27:18+00:00#e19e017515e6
teleworkable_state dingel-neiman-2020-v1@2026-08-13T09:27:18+00:00#f663415361e4

Data sources. Freddie Mac Single-Family Loan-Level Dataset (registered; subject to Freddie Mac terms of use; not redistributed here) — or labeled synthetic fixtures where indicated. Freddie Mac Primary Mortgage Market Survey. Federal Housing Finance Agency House Price Index. Home Mortgage Disclosure Act data via the Consumer Financial Protection Bureau Data Browser. U.S. Census Bureau Building Permits Survey. Retrieval timestamps and file checksums are recorded in the manifests accompanying each result artifact.