SPB Git forge

spb/wp22_uqo

Public
3commits 1branches 0releases
133.8 MBsize
maindefault branch
1 h agolast push
Python 58.4% TeX 40.8% SQL 0.6%
8.4 KB · 116 lines markdown
Rendered Raw Blame History
1<!-- Author: Simon-Pierre Boucher — simon-pierre.boucher@uqo.ca -->2# 🏘️ SHARP-HPI: A Spatially Hierarchical, Adaptive and Robust Framework for Quality-Adjusted Housing Price Indices34**UQO Working Paper No. 22** — *Monthly municipal indices for Quebec from 770,000 registered sales, 2021–2026*56[![Paper](https://img.shields.io/badge/paper-PDF-b31b1b?logo=latex&logoColor=white)](paper/main.pdf)7[![Python](https://img.shields.io/badge/python-3.14-3776AB?logo=python&logoColor=white)](requirements.txt)8[![Data](https://img.shields.io/badge/data-769%2C995%20registered%20sales%20·%20SQLite%20snapshot-4051b5)](data/raw/README.md)9[![Reproducible](https://img.shields.io/badge/reproducible-end--to--end%20pipeline-2e7d32)](scripts/)10[![Institution](https://img.shields.io/badge/UQO-D%C3%A9pt.%20des%20sciences%20administratives-16365c)](https://uqo.ca)11[![Author](https://img.shields.io/badge/author-Simon--Pierre%20Boucher-16365c)](mailto:simon-pierre.boucher@uqo.ca)1213> **TL;DR** — A two-stage index estimator for thin housing markets: a robust pooled hedonic regression with fine-scale location fixed effects and drifting quality prices (stage 1), then nested local-level state-space deviations province → region → MRC → municipality whose innovation variances are calibrated by empirical Bayes across cells (stage 2). Applied to an audited snapshot of Quebec land-registry sales (769,995 rows → 632,006 headline sales, January 2021 – 7 October 2026) matched to the assessment roll. Delivers a panel of 2,696 geography × class cells × 69 months with counts, effective sample sizes, local-data weights, 95 % intervals and A–E grades; eleven benchmarks (median → HMTS → repeat sales → QHPI); a 9-scenario Monte Carlo with two deliberate counter-examples; real-time vintages with measured revisions; placebo, composition-shock, bootstrap, Moran, ablation, aggregation and external (Teranet, CREA) checks.1415---1617## 📌 Status1819| Item | Value |20|---|---|21| Version | 1.0 (October 2026) |22| SSRN | not yet submitted |23| Journal | — |24| Code & data | reproducible from `scripts/` (see Quick start); raw microdata not redistributed |2526## 🎯 What this paper does2728The estimand is the quality-constant log price level $L_{g,k,t}$ of geography $g$, class $k$ (house, condominium, plex) and month $t$, normalised to the 2021 average = 100. The model is2930```31log P_i = f_k(x_i; θ_t) + α_{ℓ(i)} + μ_{k,t} + δ^R_{r(i),t} + δ^M_{m(i),t} + δ^U_{u(i),t} + ε_i32δ_{g,t} = δ_{g,t-1} + η_{g,t},  ȳ_{g,t} = δ_{g,t} + e_{g,t},  Var(e) = σ²_g / n_{g,t},  log τ²_g ~ N(m_level, v_level)33```3435Every ingredient exists in the literature (Francke & van de Minne 2017; Ishaak, Ouwehand & Remøy 2024; Fay & Herriot 1979; Hill et al. 2022); the paper tests whether their combination helps, where it does not, and how reliable each cell is.3637## 🏆 Headline results3839See `paper/tables/numbers.tex` (every number in the manuscript is a generated macro). Key outputs: `data/processed/index_panel.parquet|csv` (schema of protocol §17), `results/panel/reliability_cells.csv`, `results/simulation/summary.csv`, `results/vintages/revisions_by_release.csv`, `results/validation/*.csv`.4041## 🗂 Repository layout4243```44sharp-hpi-quebec/45├── CLAUDE.md                 # research protocol (as received)46├── data/raw/                 # SQLite snapshot + earlier vintages (not committed; README)47├── data/external/            # SDA boundaries (not committed), MAMH register, external indices48├── data/interim|processed/   # parquet layers; index_panel.* and index_vintages.parquet49├── src/sharp_hpi/            # config, io, cleaning, hedonic, estimators, statespace, sharp, qhpi, panel, simulate, plotting50├── scripts/                  # 01–06 data · 10–11 benchmarks · 20 Monte Carlo · 30 panel · 40–41 vintages · 50 validation · 60–62 figures/tables/external51├── tests/                    # pytest (state space, EB prior, estimators, SHARP, panel invariance)52├── results/                  # profile, geo, cleaning, vintages, benchmarks, simulation, panel, validation53├── figures/                  # generated figures (copied to paper/figures)54├── docs/                     # PLAN, decision_log, data_dictionary, provenance_report, limitations, research_log, literature/55└── paper/                    # main.tex, sections/, appendix/, tables/ (generated), references.bib (115 verified entries)56```5758## 🚀 Quick start5960```bash61python3 -m pip install -r requirements.txt62make data            # 01 extract (needs data/raw/vraiprix-20261021.db) → 06 provenance report63make benchmarks hmts # A–K at province × class and region × class64make panel           # full SHARP-HPI panel (≈ 1 min)65make vintages revisions   # real-time vintages (≈ 1 h) and revision statistics66make validation external  # placebo, composition, bootstrap, Moran, ablation, aggregation, trimming, repeat sales, Teranet/CREA67make simulation      # Monte Carlo, 80 reps × 9 scenarios (≈ 3.6 h on 12 cores)68make figures tables paper # figures, LaTeX tables + macros, PDF69make test70```7172## 🗃 Data7374Production SQLite of Vrai Prix (www.vrai-prix.com), `.backup` taken 2026-10-21 00:30; 769,995 registered sales (Quebec land registry via the Journal de Québec / Journal de Montréal feed) 2021-01-04 → 2026-10-07, geocoded and matched to the MAMH assessment roll (3.75 M units). Four earlier extractions measure the publication lag (10–13 days, no backfill). Boundaries: MRNF SDA V2026-07. External indices: Teranet–National Bank, CREA MLS HPI, Statistics Canada NHPI/RPPI (downloaded 2026-10-21). See `docs/data_dictionary.md` and `docs/provenance_report.md`.7576## 🔬 Methodology77781. `cleaning.py` — standardisation, roll-based classification, exclusion ledger.792. `hedonic.py` — features, nested-grid location partition, Huber-IRLS fixed-effects regression (pyfixest).803. `estimators.py` — benchmarks A–J (median, stratified median, pooled TD, rolling TD with 3 splices, hedonic imputation L/P/F, GEKS, HMTS, repeat sales BMN/CS, static EB, out-of-time GBM); `qhpi.py` — benchmark K.814. `statespace.py` — local level / local linear trend Kalman filter & smoother, robust innovations, grid-EM empirical-Bayes prior on log τ².825. `sharp.py` — stage 1 + nested stage 2, reliability bundle; `panel.py` — schema, normalisation, grades.836. `simulate.py` — synthetic Quebec-like markets with known latent paths (9 scenarios).8485## 🖼 Figures & tables inventory8687Figures (`figures/*.pdf`): coverage, arrival profile, province methods, region methods, municipal examples, gain vs n, hedonic profiles, municipal map, Monte Carlo RMSE and coverage, revisions, placebo, composition shock, aggregation, Moran. Tables (`paper/tables/*.tex`): exclusions, sample by year, completeness, municipality bands, vintages, stage 1, priors, grades, top municipalities, benchmarks (province, region), Monte Carlo (design, RMSE by level, coverage, bias, lag), revisions, policies, repeat sales, composition, placebo, Moran, bootstrap, aggregation, ablation, trimming, external.8889## ⚠️ Limitations9091See `docs/limitations.md`: single current roll vintage (post-sale characteristics), $50,000 provider floor, no arm's-length / listing / image data, metric-grid location, administrative hierarchy, model-based intervals narrower than a cluster bootstrap for mid-size municipalities, no seasonal adjustment, CMA boundaries unavailable.9293## 📝 Citation9495```bibtex96@techreport{boucher2026sharphpi,97  author      = {Boucher, Simon-Pierre},98  title       = {SHARP-HPI: A Spatially Hierarchical, Adaptive and Robust Framework for Quality-Adjusted Housing Price Indices},99  institution = {Universit\'e du Qu\'ebec en Outaouais, D\'epartement des sciences administratives},100  type        = {Working Paper},101  number      = {22},102  year        = {2026},103  month       = {October}104}105```106107## 👤 Author & contact108109**Simon-Pierre Boucher** — Département des sciences administratives, Université du Québec en Outaouais (UQO), Gatineau, QC.110📧 [simon-pierre.boucher@uqo.ca](mailto:simon-pierre.boucher@uqo.ca)111112## 🗒 Notes113114- Follows `Recherche-UQO/HARMONISATION.md`; the protocol asked for a folder named `uqo-research`, which does not exist — the series root `Recherche-UQO` is used (decision D0.1).115- Transaction-level files (`clean_transactions.parquet`, `analytic_transactions.parquet`, `index_panel.csv`, revision microdata) are git-ignored; aggregates are committed.116