SPB Git

spb/qwhpi Public

QHPI — Quebec Housing Price Index: quality-adjusted, hierarchically pooled housing price indexes.

Python 63.9% TypeScript 25.4% CSS 5.5% TeX 3.5% SQL 0.8% Makefile 0.5% Dockerfile 0.5%
5.4 KB · 125 lines tsx
Raw Blame History
1/**2 * =============================================================================3 * QWHPI — Quebec Weekly Housing Price Index4 * Author  : Simon-Pierre Boucher5 * Contact : contact@spboucher.ai6 * File    : web/app/methodology/page.tsx7 * Purpose : Methodology — rendered summary of the v2.1 monthly robust index.8 * =============================================================================9 */1011export default function Methodology() {12  return (13    <>14      <h1>Methodology (v2.1 — monthly, robust)</h1>15      <p className="lede">16        QHPI measures price movement, never composition movement. Version 217        rebuilt the index at monthly frequency around the rolling-time-dummy18        method used by official statistical agencies.19      </p>2021      <h2>Data</h2>22      <p>23        ~745,000 residential transactions across 1,100+ Quebec municipalities,24        January 2021 to present, spatially joined to the official SDA25        1/20&nbsp;000 boundaries. Non-arm&apos;s-length transfers, duplicates26        and portfolio-scale conveyances are excluded with a documented27        exclusion table (~3.5%). The <em>indéterminé</em> type never enters an28        index. <strong>Variables whose missingness moves over time are banned29        from the model</strong>: the provider backfilled30        <code>buildingType</code> in region-staggered waves (2022–2023), which31        would fabricate artificial index steps — it was detected by a32        composition-free arbitration and excluded; building age uses33        time-invariant conditional-median imputation.34      </p>3536      <h2>Three estimators, one family</h2>37      <ul>38        <li>39          <strong>Province × type — rolling-time-dummy (RTD).</strong>{" "}40          13-month hedonic windows re-estimated every month with Huber-robust41          weighting (outliers are downweighted inside the regression), linked42          by the <em>mean splice</em>. Published history never revises, and43          hedonic coefficients are free to drift (β on log floor area moves44          ~5% across windows).45        </li>46        <li>47          <strong>Liquid cells (≥ 40 tx/month) — direct local estimation.</strong>{" "}48          Own robust time-dummy regression (own coefficients, own postal-zone49          fixed effects) with a light state-space smoother for the real-time50          variant. Chosen because deviation-from-pooled-surface methods51          compress strong local divergences: Québec City condos appreciated52          ~+55% by repeat sales AND stratified matched-cell medians, which the53          direct estimator reproduces (+53–64%) while pooled deviations said54          +42%.55        </li>56        <li>57          <strong>Thin cells — hierarchical shrinkage.</strong> Monthly mean58          deviations from the parent path filtered by a heteroskedastic59          local-level Kalman model: liquid months speak, thin months shrink60          toward the parent.61        </li>62      </ul>6364      <h2>Validation</h2>65      <ul>66        <li>67          <strong>Repeat sales (BMN)</strong>: published levels agree within68          ±5% on six of seven benchmark cells, with high change-correlations at69          the province level. The exception (Montréal single-family, −8%) sits70          between repeat sales and the stratified matched-cell median.71        </li>72        <li>73          <strong>Stratified matched-cell medians</strong> (FSA × vintage ×74          size, regression-free) corroborate the direct estimator on every75          arbitrated cell.76        </li>77        <li>78          <strong>Downsampling</strong>: direct-estimation RMSE stays ≈1.9% at79          40 tx/month (the liquidity floor); hierarchical shrinkage takes over80          below.81        </li>82        <li>83          <strong>Composition shock</strong>: removing 70% of small-dwelling84          sales moves the raw median +12.3% but the index only −1.0%.85        </li>86        <li>87          <strong>Seasonality</strong>: no stable monthly seasonality — all88          series are NSA.89        </li>90      </ul>9192      <h2>Reliability grades</h2>93      <table className="data">94        <thead>95          <tr><th>Grade</th><th>Meaning</th><th>Liquidity</th></tr>96        </thead>97        <tbody>98          <tr><td>A</td><td>Very strong; direct estimation, tight CI</td><td>≥ 150 tx/month</td></tr>99          <tr><td>B</td><td>Strong; direct estimation</td><td>75–149</td></tr>100          <tr><td>C</td><td>Moderate; direct estimation floor</td><td>40–74</td></tr>101          <tr><td>D</td><td>Thin; hierarchical shrinkage</td><td>15–39</td></tr>102          <tr><td>E</td><td>Model-implied only</td><td>&lt; 15</td></tr>103        </tbody>104      </table>105106      <h2>Conventions</h2>107      <p>108        Base 2021 average = 100. Continuous monthly grid; the trailing month is109        flagged <code>is_partial_month</code> while registrations arrive. Every110        observation ships with a 95% interval, transaction count, effective111        sample size and shrinkage weight. First releases are preserved and112        revisions are queryable (<code>/v1/vintages</code>). Growth horizons:113        1m, 3m, 6m, YoY.114      </p>115116      <p className="note">117        Author: Simon-Pierre Boucher — contact@spboucher.ai · Key references:118        Hill, Scholz, Shimizu &amp; Steurer (2022) J. Official Statistics;119        Eurostat/IMF/OECD RPPI Handbook (2013); Bailey, Muth &amp; Nourse120        (1963); Case &amp; Shiller (1989).121      </p>122    </>123  );124}125