Skip to main content
Methodology · canonical scoring spec·5 composites · 2 hard filters · 1.7k LOC published

How ValiFit Scores Every Town in America

ValiFit publishes a town-by-town score for every incorporated place and active township in the United States. Each town is measured on five composites and filtered by two hard constraints. Every input is a federally-published value with a defined unit and a citable URL. Every score carries a bootstrap 95% confidence interval. The full pre-registered spec was timestamped 2026-05-12 and is published under CC-BY 4.0 — per FBI NIBRS 2024, NCES F-33, CDC NCHS, FEMA NFHL, and FHFA HPI as the primary federal sources.

FHA-safe (no demographic inputs)Pre-registered 2026-05-12CC-BY 4.0 methodologyBootstrap 95% CI on every score

1. The five scored composites

Each town receives a percentile score from 0 to 100 on five composites. Each composite uses one closed-form formula, one federally-defined peer cohort, and one bootstrap 95% confidence interval. No editorial weights live inside a composite — weights only appear at the user-controlled Match% layer.

Safety

Sworn-officer staffing relative to the violent-crime rate, Laplace-smoothed to handle zero counts.

Primary metric
safety_roi = (officers_per_1000 + 0.5) / (violent_crime_per_1000 + 0.5)

Formula. Higher safety_roi means more police presence per crime. The +0.5 additive (Laplace) smoothing is the defensible standard for count-based ratios where either numerator or denominator can be zero.

Cohort. State by Census population tier (13 CFR Part 121: micropolitan rural under 2,500 / small town 2,500-9,999 / small city 10,000-49,999 / mid city 50,000-249,999 / large city 250,000+). Expands to state then Census region when peer count is under 30.

Score rule. safety_score = ROUND(percentile_rank(safety_roi, cohort) x 100). Bootstrap 95% CI from 1000 resamples shown alongside every score.

Education

Graduation outcomes per dollar spent, adjusted for the difficulty of the student body (free/reduced-lunch share).

Primary metric
edu_roi_adj = (graduation_rate / (per_pupil_$ / 1000)) x (1 + (free_reduced_lunch_pct/100) x beta)

Formula. Outcome per dollar, adjusted for student-body difficulty. The beta coefficient is empirically derived from regression of per-pupil-spending residuals on F/R% across every NCES district (published in methodology-repo/verify/education-fr-coefficient.json).

Cohort. State by NCES district enrollment tier (under 300 / 300-2,500 / 2,500-10,000 / 10,000+ from NCES Common Core of Data).

Score rule. edu_score = ROUND(percentile_rank(edu_roi_adj, district_cohort) x 100). Bootstrap 95% CI shown alongside.

Health

Geometric mean of provider access and life-expectancy outcome — both must be present for a strong score.

Primary metric
health_roi = sqrt( (providers_per_1000 / 2.65) x (life_expectancy / 78.8) )

Formula. 2.65 is the national average providers per 1,000 (CMS NPI 2024); 78.8 is national average life expectancy (CDC NCHS 2024). Geometric mean is the same family the UN Human Development Index uses — one near-zero input pulls the whole score down, preventing high access from masking poor outcomes (or vice versa).

Cohort. State by county-tier (rural / mid-rural / mid-urban / urban) from USDA ERS RUCC codes, matching the County Health Rankings methodology.

Score rule. health_score = ROUND(percentile_rank(health_roi, cohort) x 100). Bootstrap 95% CI shown alongside.

Environment

Inverted percentile of federally-published environmental-hazard exposure within the town.

Primary metric
env_score = ROUND(100 x (1 - percentile_rank(risk_count, state_tier_cohort)))

Formula. risk_count = count of EPA NPL (Superfund) + EPA AQS (air-quality monitor) + EPA SDWIS (drinking-water violation) + FEMA NFHL (flood-zone overlap) + FEMA NFIP (flood-claim) exposures touching the town. Higher exposure count means lower score (inversion).

Cohort. State by Census population tier (13 CFR Part 121, same tier definitions used by Safety).

Score rule. Inverted percentile rank within state-tier cohort. Bootstrap 95% CI shown alongside.

Appreciation

Five-year FHFA House Price Index repeat-sales CAGR, EWMA-smoothed, ranked within the OMB-defined metro.

Primary metric
appreciation_cagr = (HPI_now / HPI_5yr_ago) ^ (1/5) - 1

Formula. FHFA HPI is the federally-published repeat-sales index — controls for property-quality drift in a way median sale price cannot (median price is contaminated by mix shifts). EWMA smoothing decay lambda = 0.5 weights recent years more heavily.

Cohort. Metropolitan Statistical Area (federally defined by OMB Bulletin 23-01). Expands to state then Census region when peer count is under 30.

Score rule. appreciation_score = ROUND(percentile_rank(appreciation_cagr, MSA_cohort) x 100). Bootstrap 95% CI shown alongside.

2. Hard filters (Commute, Affordability)

Two constraints are intentionally NOT scored as composites — they are intrinsically user-specific and applied as hard-filters at match time. Locked per task #129 (Commute, 2026-05-29 with 2026-06-10 re-lock) and task #245 (Affordability).

Commute (hard-filter, not scored)

What. Commute is not a town composite. It is a per-user hard-filter applied at match time using your intake destinations and max-minutes thresholds.

How. commute_burden = sum (haversine_minutes_i x frequency_weight_i) / sum (frequency_weight_i). haversine_minutes = (haversine_miles x 60) / mode_speed where mode_speed in mph is car=35, transit=15, bike=12, walk=3 (BTS National Household Travel Survey averages). Towns exceeding your max-minutes for any frequent destination are filtered out before scoring.

Why hard-filter not composite. Commute is intrinsically user-specific — the same town can be a 12-minute drive for one buyer and a 90-minute drive for another. Putting commute in the geometric-mean blend would punish or reward towns based on a destination that has nothing to do with the town itself. Per locked task #129 (2026-05-29) and re-locked 2026-06-10 PM, commute stays a hard-filter, never a composite.

Affordability (hard-filter, not scored)

What. Affordability is also not a composite. It is a hard-filter on debt-to-income: towns whose median list price would push your DTI past the cap from your intake are filtered out via /api/affordability before scoring.

How. qualifying_income = monthly_PITI / (front_end_DTI_cap). PITI = principal + interest at the current Freddie PMMS 30-year fixed rate + property tax (county effective rate) + homeowners insurance + PMI when down payment is under 20%. FHA path applies if list price is at or below the county FHA loan limit; conventional path otherwise.

Why hard-filter not composite. Affordability is binary at the buyer level (either you can carry the payment or you cannot), so a continuous percentile score would be misleading. Per locked task #245, affordability is enforced as a hard-filter and not blended into Match%. The output is yes/no plus the qualifying income, monthly payment, and county FHA limit reference.

3. How Match% works

The five composite scores are blended into a personalized Match% using the weights you set during intake. The blend formula is the weighted geometric mean:

match_pct = product(composite_score_i ^ user_weight_i) ^ (1 / sum(user_weight_i))

Why a geometric mean rather than an arithmetic average: the geometric mean correctly penalizes imbalance under compensatory utility theory — a low value in a heavily-weighted dimension cannot be made up by a high value elsewhere. The UN Human Development Index uses the same approach for the same reason.

The five composite percentiles for any town are identical for every user — they are cohort-relative, not user-relative. Only the personal weight vector changes the blend. ValiFit cannot cherry-pick: the underlying truth about each town is invariant; the personal lens is yours to set. The match-percent code is in lib/composites/match-percent.ts and the property tests (monotonicity, fairness invariance, edge cases) live in __tests__/methodology-defensibility.test.ts.

Edge-case handling
  • Weight of zero on a composite excludes it silently (you opted out).
  • Null score on a composite excludes it with a warning; the remaining weight is redistributed.
  • Score of zero is floored at 0.5 so the geometric product is not annihilated.

4. Cohort and statistical method

Every score is a percentile rank within a federally-defined peer cohort. The cohort is never picked by ValiFit — it follows federal classifications so the same calculation can be reproduced by anyone with the source data.

Minimum cohort size
N ≥ 30 peers. If smaller, expand outward (next tier, then state, then Census region) until met.
Confidence interval
Bootstrap 1,000 resamples, deterministic seed for reproducibility, 2.5% / 97.5% empirical quantiles.
Bayesian shrinkage
For 30 ≤ N ≤ 100, James-Stein shrinkage toward the state-median prior. Converges to raw percentile as N grows.
Biased-cohort guard
If more than 50% of cohort peers are missing the primary metric, the remaining peers are self-selected — score returns null with reason biased_cohort.
Outlier handling
Tukey fences (1.5 × IQR) for cohort statistics. Outliers contribute to rank but do not distort the CI.
Time smoothing
EWMA with decay λ = 0.5 for time-series inputs (crime, grad rate, appreciation HPI). Recent years weighted more heavily.

Reference implementation: lib/composites/math/percentile.ts (percentileRank, bootstrapCI, expandCohort, computePercentileWithExpansion). Pre-registered spec: docs/SCORING_METHODOLOGY_v1.md.

5. Data sources

Every input to every score comes from one of these federally- or authoritatively-published datasets. Complete catalog with refresh cadence is at /trust/sources and /sources.

6. What ValiFit will never do

These commitments are enforced in code, not in marketing copy. Each one corresponds to an iron-jaw antibody, a constitutional charter, or a federal-law constraint.

  • Never call a town "best" or "safest"
    Per the Q7 match-not-claim doctrine, the language used everywhere on the site is "matches you at X%" not "is the best." Every score is presented with its federal source citation inline (for example, "per FBI NIBRS 2024") and its bootstrap 95% CI. Enforced by the no-claim-style-language-on-scores iron-jaw antibody.
  • Never use demographic data in scoring
    No race, ethnicity, religion, national origin, family status (children), or disability data ever enters a composite formula. The Fair Housing Act and Equal Credit Opportunity Act prohibit demographic steering, and ValiFit measures infrastructure investment (officers, providers, per-pupil spending, environmental hazards) instead. Passes 24 CFR Section 100.500 disparate-impact analysis.
  • Never give agents preferential ranking
    No agent can pay for a ranking boost. No listing receives editorial promotion. The scoring code is identical for every property regardless of whether the listing agent has a paid ValiFit account. Lead-routing neutrality is one of the six constitutional charters at /trust/charters.
  • Never fabricate a score
    When federal source data is missing for a factor, the omit-not-default rule applies: the factor is dropped from the composite, the score is recomputed from the remaining factors, and if the entire composite cannot be honestly computed it returns null with an explicit reason (insufficient_cohort, missing_primary_input, or biased_cohort). On the page that composite is marked unavailable, never faked with a hardcoded default.
  • Never change methodology without versioning
    The pre-registered spec is timestamped 2026-05-12 and any change requires a versioned release, a changelog entry, an iron-jaw audit, and a PR review. Methodology is locked; only the data refreshes on its federal cadence. The pre-registration timestamp is the prior-art shield against post-hoc tuning claims.
  • Never auth-wall a citable page
    Town pages, property pages, methodology, trust pages, and the federal-source glossary stay free and crawlable forever per the IMDb-gating-policy lock (2026-05-17). Action-layer surfaces (DMs, tour booking, PDF dossier export, agent CRM) are the paid product — the public-citation surface stays open.

7. Transparency and source code

ValiFit publishes the spec, the implementation, and the audit trail. Anyone with federal source data can independently recompute any score on the site.

Citation: ValiFit, LLC. (2026). ValiFit Scoring Methodology v1.0.0. CC-BY 4.0. Available at github.com/v4lifit-dotcom/valifit-scoring-methodology. Pre-registered 2026-05-12. Last modified 2026-06-18.

8. Frequently asked questions

These answers are mirrored in a Schema.org FAQPage block on the same URL so AI search and rich-results crawlers can ingest them structured. Each answer carries its own federal-source citation where applicable.

How does ValiFit calculate town scores?
ValiFit scores every town in America on five composites — Safety, Education, Health, Environment, and Appreciation — using only federally-published data. Each composite is a closed-form formula computed from federal inputs, then percentile-ranked against a state-tier peer cohort with a bootstrap 95% confidence interval. The five composite scores are blended into a personalized Match% using the weights you set during intake.
How does ValiFit calculate safety scores?
Safety is computed as safety_roi = (officers_per_1000 + 0.5) / (violent_crime_per_1000 + 0.5) per FBI UCR / LEE 2024 and FBI NIBRS 2024. The +0.5 additive (Laplace) smoothing handles zero counts defensibly. The town is percentile-ranked within its state-by-population-tier peer cohort, and the score is shown with a bootstrap 95% confidence interval.
How does ValiFit calculate education scores?
Education is computed as edu_roi_adj = (graduation_rate / (per_pupil_$ / 1000)) x (1 + (free_reduced_lunch_pct/100) x beta) per NCES F-33 and EdFacts ACGR. The free/reduced-lunch coefficient adjusts for student-body difficulty. The district is percentile-ranked within state-by-NCES-enrollment-tier peers with a bootstrap 95% CI.
How does ValiFit calculate health scores?
Health is computed as health_roi = sqrt((providers_per_1000 / 2.65) x (life_expectancy / 78.8)) per CMS NPI 2024 and CDC NCHS. The geometric-mean form (same family as the UN Human Development Index) requires both access and outcome to be strong. The county is percentile-ranked within state-by-USDA-RUCC-tier peers with a bootstrap 95% CI.
How does ValiFit calculate environment scores?
Environment is the inverted percentile of risk_count = EPA NPL + EPA AQS + EPA SDWIS + FEMA NFHL + FEMA NFIP exposure tallies within the town. Higher exposure count yields a lower score. The town is percentile-ranked within its state-by-population-tier peer cohort with a bootstrap 95% CI.
How does ValiFit calculate appreciation scores?
Appreciation is the five-year FHFA House Price Index repeat-sales CAGR, EWMA-smoothed (decay 0.5) and percentile-ranked within the OMB-defined Metropolitan Statistical Area. FHFA HPI is the federally-published repeat-sales index that controls for property-quality drift in a way median sale price cannot.
How does Match% work?
Match% is the weighted geometric mean of the five composite scores: match_pct = product(composite_score_i ^ user_weight_i) ^ (1 / sum(user_weight_i)). Geometric mean (the same compensatory utility theory the UN HDI uses) prevents one high composite from masking a low one in a heavily-weighted dimension. The five composite percentiles are identical for every user; only the personal weight vector changes the blend.
Why is commute not a composite?
Commute is intrinsically user-specific — the same town is a 12-minute drive for one buyer and a 90-minute drive for another. Putting it in the scored blend would punish or reward towns based on a destination that has nothing to do with the town. Commute is applied as a hard-filter at match time using your intake destinations and max-minutes thresholds. Locked per task #129 (2026-05-29, re-locked 2026-06-10).
Why is affordability not a composite?
Affordability is binary at the buyer level — either you can carry the payment or you cannot — so a continuous percentile score would be misleading. ValiFit enforces affordability as a hard-filter via /api/affordability, computing qualifying income from list price, current Freddie PMMS 30-year rate, county tax, insurance, and PMI. Locked per task #245.
What cohort does ValiFit use for percentile ranking?
Cohorts are federally defined: state by Census population tier (13 CFR Part 121) for Safety and Environment; state by NCES enrollment tier for Education; state by USDA RUCC county-tier for Health; OMB-defined Metropolitan Statistical Area for Appreciation. When a cohort has fewer than 30 peers, ValiFit expands outward (next tier, then state, then Census region) until N is at least 30. If even the widest cohort has fewer than 30 peers, the score returns null with reason insufficient_cohort — never a fabricated number.
How are confidence intervals computed?
Every score is published with a 95% confidence interval from a bootstrap of 1,000 resamples (deterministic seed for reproducibility). The bootstrap is mathematically equivalent to a Bayesian posterior under a uniform prior. For cohorts between 30 and 100 peers, ValiFit also applies James-Stein-style Bayesian shrinkage toward the state-median prior, tightening estimates for small samples while converging to the raw percentile as N grows.
Is ValiFit FHA-safe?
Yes. ValiFit measures infrastructure investment (officers, providers, per-pupil spending, environmental hazards) — never demographic outcomes. No race, ethnicity, religion, family-status, or disability data enters any composite formula. ValiFit passes 24 CFR Section 100.500 disparate-impact analysis. Quarterly bias audit per the constitutional charter at /trust/bias-audit.
Does ValiFit ever say a town is best?
No. ValiFit reports the data and computes a personalized match per source. The language used everywhere on the site is "matches you at X%" not "is the best." Every score carries its federal source citation inline, every cohort comparison is published, every formula is open. The user decides what matters.
Is real estate agent lead routing neutral?
No. Lead routing is neutral per ValiFit's constitutional charter at /trust/charters. No agent can pay for a ranking boost, no listing receives editorial promotion, and the scoring code is identical for every property regardless of whether the listing agent has a paid ValiFit account.
How often is ValiFit data refreshed?
Refresh cadence follows the federal source: daily for active listings and mortgage rates; monthly for FEMA NFIP, HRSA HPSA, Overture Maps, and Census Building Permits; quarterly for CMS Hospital Quality, BLS QCEW, and FHFA HPI; annual for NCES F-33, EdFacts ACGR, FBI UCR, FHA limits, and BEA personal income; biennial for CRDC. Every score shows its source vintage on the entity page.
Where can I see the scoring code and methodology spec?
The pre-registered methodology spec is published at /docs/SCORING_METHODOLOGY_v1.md and mirrored on GitHub at github.com/v4lifit-dotcom/valifit-scoring-methodology under CC-BY 4.0. The scoring implementation lives in lib/composites/unified-scorer.ts and lib/composites/math/percentile.ts. Any change requires a versioned release with changelog entry — the pre-registration is timestamped 2026-05-12 as prior art.
What happens when federal source data is missing for a town?
Per the omit-not-default rule, ValiFit never substitutes a hardcoded value while still attaching the federal source citation. A factor with missing source data is omitted from the composite, and the score is recomputed from the remaining factors. If the entire composite cannot be computed, it returns null with an explicit reason (insufficient_cohort, missing_primary_input, or biased_cohort) — and on the user-facing page that composite is marked unavailable, never faked.