Tweedie GLM β Fentanyl Overdose Rate Forecasting
Author: Ansh Gupta
Overview
A Tweedie Generalized Linear Model (GLM) for forecasting census tract-level fentanyl/opioid overdose rates in King County, Washington. The model integrates American Community Survey (ACS) census data, Group-Based Trajectory Modeling (GBTM) cluster assignments, and a year-over-year overdose rate velocity feature to predict future overdose rates per 100,000 population.
Performance (5-Fold Cross-Validation)
| Metric | Value |
|---|---|
| RΒ² | 0.861 |
| MAE | 8.50 per 100,000 |
| Spearman Ο | 0.859 |
| Top-10 Overlap | 100.0% |
| BPR K=10 | 100.0% |
| Top-20 Overlap | 95.0% |
| BPR K=20 | 98.7% |
| Top-50 Overlap | 66.0% |
| BPR K=50 | 89.2% |
| Mean BPR (K=5β200) | 94.9% |
Features
| Feature | Description |
|---|---|
| Med_HHD_Inc_Thousands_ACS__ | Median household income (thousands) |
| pct_Renter_Occp_HU_ACS__ | % renter-occupied housing units |
| pct_Vacant_Units_ACS__ | % vacant housing units |
| pct_Not_HS_Grad_ACS__ | % without high school diploma |
| pct_College_ACS__ | % with college degree |
| pct_NH_Blk_alone_ACS__ | % non-Hispanic Black population |
| Pct_No_Health_Ins_CALCULATED_ACS__ | % without health insurance |
| Med_HHD_Inc_Thousands_ACS___Neighbor_Avg | Average median income of 3 nearest neighbor tracts |
| pct_Vacant_Units_ACS___Neighbor_Avg | Average vacancy rate of 3 nearest neighbor tracts |
| pct_Renter_Occp_HU_ACS___Neighbor_Avg | Average renter rate of 3 nearest neighbor tracts |
| Cluster_1 | GBTM trajectory cluster 1 indicator |
| Cluster_2 | GBTM trajectory cluster 2 indicator |
| Cluster_3 | GBTM trajectory cluster 3 indicator |
| Velocity_1Yr | Year-over-year change in overdose rate (Rate_2024 β Rate_2023) |
Model Specification
| Parameter | Value |
|---|---|
| Family | Tweedie |
| Link Function | Log |
| Variance Power | 1.5 |
| Velocity Formula | Rate_2024 β Rate_2023 |
Validation
- Temporal: Out-of-time forecast (trained on β€2024 data, predicting 2025 TTM rates)
- Cross-validation: 5-fold CV β every tract predicted by a model never trained on it
- Geographic: Cross-regional transfer validated on Los Angeles County, CA
Training Data
- Region: King County, Washington (463 census tracts)
- Target: Overdose death rate per 100,000 (2025 trailing twelve months)
- Census data: ACS 5-year estimates (2019β2023)
Usage
import pickle
import statsmodels.api as sm
import pandas as pd
# Load model
with open("tweedie_model.pkl", "rb") as f:
result = pickle.load(f)
# View coefficients and rate ratios
print(result.summary())
# Predict on new data
predictions = result.predict(sm.add_constant(your_features_df))
Files
| File | Description |
|---|---|
tweedie_model.pkl |
Fitted statsmodels GLM result object |
coefficients.json |
All coefficients, rate ratios, and p-values (readable JSON) |
model_config.json |
Model configuration (family, link, var_power, features) |
model_summary.txt |
Full statsmodels summary table |
training_data.csv |
Full training dataset (463 tracts) |
License
MIT
Inference Providers NEW
This model isn't deployed by any Inference Provider. π Ask for provider support