import%20marimo%0A%0A__generated_with%20%3D%20%220.23.9%22%0Aapp%20%3D%20marimo.App(width%3D%22medium%22)%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%23%20Flood%2Fsurge%20catastrophe%20loss%20model%20%E2%80%94%202024%20Helene%2FMilton%20calibration%0A%0A%20%20%20%20A%20*deterministic*%20cat-model%20chain%20(Hazard%20-%3E%20Exposure%20-%3E%20Vulnerability%20-%3E%20Financial)%0A%20%20%20%20over%20all%20St-Pete%20single-family%20parcels%2C%20run%20on%20the%202024%20storm-surge%20footprint%20and%0A%20%20%20%20triangulated%20against%20independent%20ground%20truth.%20**Milestone%3A%20reproduce%202024.**%0A%0A%20%20%20%20**Documented%20limits%20(state%20up%20front)%3A**%20the%20hazard%20is%20a%20still-water%20surface%0A%20%20%20%20interpolated%20from%20USGS%20high-water%20marks%20%E2%80%94%20it%20ignores%20wave%20action%2C%20overland%0A%20%20%20%20attenuation%2C%20and%20storm%20timing.%20Key%20inputs%20(first-floor%20height%2C%20replacement%20cost)%20are%0A%20%20%20%20genuinely%20uncertain%2C%20so%20the%20model%20ships%20with%20a%20sensitivity%20sweep%2C%20not%20a%20single%20point%0A%20%20%20%20estimate.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20import%20sys%0A%20%20%20%20import%20pathlib%0A%0A%20%20%20%20_root%20%3D%20pathlib.Path(__file__).resolve().parents%5B1%5D%0A%20%20%20%20if%20str(_root)%20not%20in%20sys.path%3A%0A%20%20%20%20%20%20%20%20sys.path.insert(0%2C%20str(_root))%0A%0A%20%20%20%20from%20pathlib%20import%20Path%0A%20%20%20%20import%20duckdb%0A%20%20%20%20import%20marimo%20as%20mo%0A%20%20%20%20import%20numpy%20as%20np%0A%20%20%20%20import%20pandas%20as%20pd%0A%20%20%20%20import%20matplotlib.pyplot%20as%20plt%0A%0A%20%20%20%20from%20analysis.catmodel%20import%20exposure%2C%20hazard%2C%20vulnerability%2C%20financial%0A%0A%20%20%20%20return%20(%0A%20%20%20%20%20%20%20%20Path%2C%0A%20%20%20%20%20%20%20%20duckdb%2C%0A%20%20%20%20%20%20%20%20exposure%2C%0A%20%20%20%20%20%20%20%20financial%2C%0A%20%20%20%20%20%20%20%20hazard%2C%0A%20%20%20%20%20%20%20%20mo%2C%0A%20%20%20%20%20%20%20%20np%2C%0A%20%20%20%20%20%20%20%20pd%2C%0A%20%20%20%20%20%20%20%20plt%2C%0A%20%20%20%20%20%20%20%20vulnerability%2C%0A%20%20%20%20)%0A%0A%0A%40app.cell%0Adef%20_()%3A%0A%20%20%20%20%23%20Module-level%20constant%3A%20widen%20the%20IDW%20search%20cap%20to%20include%20regional%20HWM%20marks.%0A%20%20%20%20%23%20See%20the%20hazard-surface%20documentation%20cell%20below%20for%20rationale.%0A%20%20%20%20MAX_DIST_KM%20%3D%2060%0A%20%20%20%20return%20(MAX_DIST_KM%2C)%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%23%23%20Hazard%20surface%20%E2%80%94%20design%20note%20on%20STN%20coverage%0A%0A%20%20%20%20USGS%20Short-Term%20Network%20(STN)%20high-water%20mark%20coverage%20is%20sparse%3A%20the%20nearest%20mark%0A%20%20%20%20to%20St.%20Petersburg%20is%20approximately%2045%20km%20away.%20%20With%20the%20default%20%60max_dist_km%3D10%60%0A%20%20%20%20cap%2C%20IDW%20returns%20NaN%20for%20the%20entire%20St-Pete%20parcel%20set%20(zero%20flood%20depth%20everywhere).%0A%0A%20%20%20%20**Decision%3A**%20widen%20%60MAX_DIST_KM%60%20to%2060%20km%20so%20the%20regional%20STN%20marks%20%E2%80%94%20which%0A%20%20%20%20bracket%20St.%20Petersburg%20at%20~8%E2%80%939%20ft%20NAVD88%20%E2%80%94%20are%20included%20in%20the%20interpolation.%0A%20%20%20%20With%20only%20a%20handful%20of%20marks%20over%20a%2060%20km%20radius%2C%20the%20IDW%20surface%20collapses%20toward%0A%20%20%20%20a%20near-planar%20regional%20stillwater%20level%20(~8%E2%80%939%20ft%20NAVD88).%20%20This%20is%20consistent%20with%0A%20%20%20%20**design%20spec%20assumption%20%235**%20(planar%2Fbathtub%20on%20DEM)%20made%20explicit%3A%20the%20model%0A%20%20%20%20treats%20the%20Helene%20peak%20as%20a%20regionally%20uniform%20surge%20level%20and%20subtracts%20each%0A%20%20%20%20parcel's%20lowest-floor%20elevation%20to%20get%20depth.%0A%0A%20%20%20%20The%20**NOAA%20St.%20Petersburg%20tide-gauge**%20(station%208726520)%20recorded%20a%20Helene%20peak%20of%0A%20%20%20%20approximately%20**6.31%20ft%20above%20MHHW**%20(%E2%89%88%207.3%E2%80%937.5%20ft%20NAVD88%20after%20the%20local%0A%20%20%20%20MHHW%E2%86%92NAVD88%20offset%20of%20~1.1%20ft).%20%20This%20gauge%20reading%20is%20used%20as%20a%20**rung-A%0A%20%20%20%20cross-check**%3A%20the%20regional%20HWM%20surface%20(~8%E2%80%939%20ft%20NAVD88)%20is%20slightly%20above%20the%20gauge%0A%20%20%20%20peak%2C%20consistent%20with%20the%20gauge%20sitting%20at%20a%20sheltered%20harbour%20location%20while%20open-bay%0A%20%20%20%20and%20low-lying%20areas%20experience%20higher%20surge.%20%20Agreement%20within%20~1%20ft%20confirms%20the%0A%20%20%20%20surface%20is%20in-band.%0A%0A%20%20%20%20**Datum%20note%3A**%20DEM%20ground%20elevations%20and%20HWM%20elevations%20are%20both%20NAVD88%20(ft)%2C%20so%0A%20%20%20%20%60depth%20%3D%20stillwater%20%E2%88%92%20lowest_floor%60%20is%20a%20datum-consistent%20subtraction.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%23%23%20Model%20assumptions%0A%0A%20%20%20%20%7C%20Assumption%20%7C%20Value%20%7C%20Leverage%20%7C%20Notes%20%7C%0A%20%20%20%20%7C---%7C---%7C---%7C---%7C%0A%20%20%20%20%7C%20First-floor%20height%20(FFH)%2C%20slab-on-grade%20%7C%201.0%20ft%20%7C%20HIGH%20%7C%20Swept%200.5%E2%80%933.0%20ft%20below%20%7C%0A%20%20%20%20%7C%20FFH%2C%20elevation-cert%20parcels%20%7C%208.0%20ft%20%7C%20HIGH%20%7C%20Elevated%20on%20piers%2Ffill%20%7C%0A%20%20%20%20%7C%20Replacement%20cost%20(RCV)%20%7C%20%24180%2Fsqft%20%C3%97%20sqft_living%20%7C%20MEDIUM%20%7C%20Swept%20%24150%E2%80%93%24250%20below%20%7C%0A%20%20%20%20%7C%20Contents%20ratio%20%7C%2050%25%20of%20structure%20RCV%20%7C%20MEDIUM%20%7C%20Hazus%20residential%20default%20%7C%0A%20%20%20%20%7C%20Stories%20%7C%201%20(generic%20one-story%20curve)%20%7C%20LOW%20for%20Phase%201%20%7C%20PCPAO%20STORIES%20field%20exists%20but%20Phase%201%20ships%20one%20generic%20curve%3B%20unused%20%7C%0A%20%20%20%20%7C%20PCPAO%20JUST_BUILDING%20%7C%20**Not%20used**%20%7C%20%E2%80%94%20%7C%20PCPAO%20just-value%20is%20depreciated%20market%20value%2C%20not%20replacement-cost-new%3B%20RCV%20%3D%20sqft%20%C3%97%20%24%2Fsqft%20is%20the%20correct%20insurance%20rebuild%20basis%20%7C%0A%20%20%20%20%7C%20NFIP%20deductible%20%7C%20%241%2C250%20%7C%20LOW%20%7C%20Statutory%20minimum%20residential%20%7C%0A%20%20%20%20%7C%20HWM%20IDW%20cap%20%7C%2060%20km%20%7C%20DESIGN%20%7C%20Wider%20than%20default%2010%20km%3B%20see%20hazard-surface%20note%20above%20%7C%0A%0A%20%20%20%20**Task-6%20note%3A**%20PCPAO's%20%60JUST_BUILDING%60%20column%20is%20a%20depreciated%20just-market%20value%2C%0A%20%20%20%20not%20replacement-cost-new%2C%20so%20it%20is%20intentionally%20NOT%20used%20as%20the%20RCV%20input.%0A%20%20%20%20RCV%20%3D%20%60sqft_living%20%C3%97%20cost_per_sqft%60%20is%20the%20appropriate%20insurance%20rebuild%20basis.%0A%20%20%20%20%60STORIES%60%20exists%20in%20PCPAO%20but%20Phase%201%20ships%20only%20the%20generic%20one-story%0A%20%20%20%20depth-damage%20curve%3B%20multi-story%20curve%20selection%20is%20deferred%20to%20Phase%202.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(Path%2C%20duckdb)%3A%0A%20%20%20%20def%20_find_db()%20-%3E%20str%3A%0A%20%20%20%20%20%20%20%20for%20d%20in%20%5BPath.cwd()%2C%20*Path.cwd().parents%5D%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(d%20%2F%20%22analytics.db%22).exists()%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20str(d%20%2F%20%22analytics.db%22)%0A%20%20%20%20%20%20%20%20raise%20FileNotFoundError(%22analytics.db%20not%20found%20walking%20up%20from%20cwd%22)%0A%0A%20%20%20%20conn%20%3D%20duckdb.connect(_find_db()%2C%20read_only%3DTrue)%20%20%23%20read-only%3A%20project%20convention%0A%20%20%20%20return%20(conn%2C)%0A%0A%0A%40app.cell%0Adef%20_(MAX_DIST_KM%2C%20conn%2C%20exposure%2C%20financial%2C%20hazard%2C%20vulnerability)%3A%0A%20%20%20%20%23%20Full%20chain%20at%20default%20assumptions.%0A%20%20%20%20exp%20%3D%20exposure.load_exposure(conn)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20FFH%3D1.0%2F8.0%2C%20%24180%2Fsqft%2C%2050%25%20contents%0A%20%20%20%20hwm%20%3D%20hazard.load_hwm(conn)%0A%20%20%20%20haz%20%3D%20hazard.assign_flood_depth(exp%2C%20hwm%2C%20max_dist_km%3DMAX_DIST_KM)%0A%20%20%20%20curve%20%3D%20vulnerability.load_curve(%22usace_1story_nobasement%22)%0A%20%20%20%20vul%20%3D%20vulnerability.apply_vulnerability(haz%2C%20curve)%0A%20%20%20%20losses%20%3D%20financial.apply_financial(vul)%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%23%20NFIP%20terms%2C%20%241%2C250%20deductible%0A%20%20%20%20losses%5B%22ridge%22%5D%20%3D%20losses%5B%22zip%22%5D.isin(%5B%2233710%22%2C%20%2233713%22%5D)%0A%20%20%20%20return%20curve%2C%20exp%2C%20hwm%2C%20losses%0A%0A%0A%40app.cell%0Adef%20_(conn%2C%20financial%2C%20losses)%3A%0A%20%20%20%20%23%20Shared%20per-block-group%20take-up%20frame%20(single%20source%20of%20truth%20for%20both%20the%0A%20%20%20%20%23%20portfolio%20headline%20and%20the%20rung-C%20de-confounding%20%E2%80%94%20avoids%20drift%20between%20cells).%0A%20%20%20%20%23%20take_up%20%3D%20policies-in-force%20%2F%20modeled%20SFR%20parcels%3B%20the%20inner%20join%20on%20parcel_id%0A%20%20%20%20%23%20guarantees%20sfr_parcels%20%3E%3D%201%2C%20so%20the%20division%20is%20always%20safe.%20The%20helper%20clips%0A%20%20%20%20%23%20the%20rate%20to%20%5B0%2C%201%5D%20(condos%2Fcommercial%20in%20the%20policy%20count%20can%20push%20it%20%3E1).%0A%20%20%20%20_xwalk%20%3D%20conn.execute(%22SELECT%20parcel_id%2C%20block_group%20FROM%20parcel_block_group%22).fetchdf()%0A%20%20%20%20_pol%20%3D%20conn.execute(%0A%20%20%20%20%20%20%20%20%22SELECT%20geo_id%20AS%20block_group%2C%20policy_count%20FROM%20nfip_policies%20WHERE%20geo_grain%3D'block_group'%22%0A%20%20%20%20).fetchdf()%0A%20%20%20%20bg_takeup%20%3D%20(losses.merge(_xwalk%2C%20on%3D%22parcel_id%22%2C%20how%3D%22inner%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.groupby(%22block_group%22%2C%20as_index%3DFalse)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.agg(insured_loss%3D(%22insured_loss%22%2C%20%22sum%22)%2C%20sfr_parcels%3D(%22parcel_id%22%2C%20%22size%22))%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.merge(_pol%2C%20on%3D%22block_group%22%2C%20how%3D%22left%22))%0A%20%20%20%20_rate%20%3D%20(bg_takeup%5B%22policy_count%22%5D.fillna(0)%20%2F%20bg_takeup%5B%22sfr_parcels%22%5D).to_numpy()%0A%20%20%20%20bg_takeup%5B%22insured_loss_takeup%22%5D%20%3D%20financial.take_up_adjusted_loss(%0A%20%20%20%20%20%20%20%20bg_takeup%5B%22insured_loss%22%5D.to_numpy()%2C%20_rate%0A%20%20%20%20)%0A%20%20%20%20return%20(bg_takeup%2C)%0A%0A%0A%40app.cell%0Adef%20_(bg_takeup%2C%20losses%2C%20mo)%3A%0A%20%20%20%20%23%20depth_ft%20%3E%200%20%3D%20water%20above%20the%20first%20floor%20(strictly%20flooded).%0A%20%20%20%20%23%20Note%3A%20the%20depth-damage%20curve%20also%20assigns%20minor%20damage%20(%3C13%25%20structure)%20to%0A%20%20%20%20%23%20parcels%20with%20depth%20in%20the%20(-1%2C%200)%20band%20(water%20just%20below%20the%20floor)%2C%20so%0A%20%20%20%20%23%20total%20ground-up%20loss%20includes%20a%20small%20contribution%20from%20that%20sub-floor%20band%0A%20%20%20%20%23%20that%20is%20NOT%20captured%20by%20the%20%60flooded%60%20count%20below.%0A%20%20%20%20flooded%20%3D%20losses%5Blosses%5B%22depth_ft%22%5D%20%3E%200%5D%0A%20%20%20%20%23%20Take-up-adjusted%20insured%20loss%20over%20the%20FULL%20modeled%20portfolio%20(from%20the%20shared%20frame).%0A%20%20%20%20_insured_takeup%20%3D%20bg_takeup%5B%22insured_loss_takeup%22%5D.sum()%0A%0A%20%20%20%20summary%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%22parcels%20modeled%22%3A%20len(losses)%2C%0A%20%20%20%20%20%20%20%20%22parcels%20with%20depth%20%3E%200%22%3A%20len(flooded)%2C%0A%20%20%20%20%20%20%20%20%22ground-up%20(economic)%20loss%20(%24M)%22%3A%20round(losses%5B%22ground_up_loss%22%5D.sum()%20%2F%201e6%2C%201)%2C%0A%20%20%20%20%20%20%20%20%22insured%20loss%20%40%20100%25%20take-up%20(%24M)%22%3A%20round(losses%5B%22insured_loss%22%5D.sum()%20%2F%201e6%2C%201)%2C%0A%20%20%20%20%20%20%20%20%22insured%20loss%20%40%20est.%20take-up%20(%24M)%22%3A%20round(_insured_takeup%20%2F%201e6%2C%201)%2C%0A%20%20%20%20%20%20%20%20%22ridge%20ground-up%20(%24M)%22%3A%20round(losses.loc%5Blosses%5B%22ridge%22%5D%2C%20%22ground_up_loss%22%5D.sum()%20%2F%201e6%2C%202)%2C%0A%20%20%20%20%7D%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%23%23%20Portfolio%20result%20(default%20assumptions)%0A%0A%20%20%20%20%7C%20metric%20%7C%20value%20%7C%0A%20%20%20%20%7C---%7C---%7C%0A%20%20%20%20%22%22%22%20%2B%20%22%5Cn%22.join(f%22%7C%20%7Bk%7D%20%7C%20%7Bv%3A%2C%7D%20%7C%22%20for%20k%2C%20v%20in%20summary.items())%20%2B%20%22%22%22%0A%0A%20%20%20%20The%20analytical%20story%3A%20the%20dry%20**33710%2F33713%20ridge%20sub-portfolio%20contributes%0A%20%20%20%20near-zero%20loss**%20while%20the%20coast%20carries%20the%20entire%20tail.%0A%0A%20%20%20%20*Depth-damage%20note%3A*%20%22parcels%20with%20depth%20%3E%200%22%20counts%20structures%20with%20water%0A%20%20%20%20above%20the%20first%20floor.%20The%20depth-damage%20curve%20also%20assigns%20minor%20damage%0A%20%20%20%20(up%20to%20~13%25%20structure)%20to%20a%20thin%20band%20of%20parcels%20where%20depth%20is%20in%20the%0A%20%20%20%20(-1%2C%200)%20ft%20interval%20(water%20just%20below%20the%20floor)%3B%20those%20parcels%20are%20not%0A%20%20%20%20counted%20in%20the%20flooded%20row%20above%20but%20do%20contribute%20to%20the%20ground-up%20loss%20total.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(losses%2C%20mo%2C%20np%2C%20plt)%3A%0A%20%20%20%20%23%20Spatial%20view%20of%20the%20result%3A%20modeled%202024%20surge%20above%20ground%20per%20parcel.%0A%20%20%20%20%23%20surge_above_ground%20%3D%20stillwater_elev_ft%20-%20ground_elev_ft%20(both%20NAVD88%20ft).%0A%20%20%20%20%23%20NOTE%3A%20this%20is%20surge%20above%20GROUND%3B%20the%20loss%20model%20uses%20depth%20above%20the%20FIRST%20FLOOR%0A%20%20%20%20%23%20(one%20FFH%20higher)%2C%20so%20a%20few%20shallow-ground%20parcels%20here%20do%20not%20reach%20their%20floor.%0A%20%20%20%20_m%20%3D%20losses%5B%5B%22latitude%22%2C%20%22longitude%22%2C%20%22zip%22%2C%20%22ground_elev_ft%22%2C%20%22stillwater_elev_ft%22%5D%5D.dropna(%0A%20%20%20%20%20%20%20%20subset%3D%5B%22latitude%22%2C%20%22longitude%22%2C%20%22ground_elev_ft%22%2C%20%22stillwater_elev_ft%22%5D%0A%20%20%20%20).copy()%0A%20%20%20%20_m%5B%22surge%22%5D%20%3D%20_m%5B%22stillwater_elev_ft%22%5D%20-%20_m%5B%22ground_elev_ft%22%5D%0A%20%20%20%20_dry%20%3D%20_m%5B_m%5B%22surge%22%5D%20%3C%3D%200%5D%0A%20%20%20%20_fl%20%3D%20_m%5B_m%5B%22surge%22%5D%20%3E%200%5D.sort_values(%22surge%22)%20%20%23%20draw%20deeper%20points%20last%0A%0A%20%20%20%20_fig%2C%20_ax%20%3D%20plt.subplots(figsize%3D(8%2C%209))%0A%20%20%20%20_ax.scatter(_dry%5B%22longitude%22%5D%2C%20_dry%5B%22latitude%22%5D%2C%20s%3D2%2C%20c%3D%22%23d7dbe0%22%2C%20linewidths%3D0)%0A%20%20%20%20_sc%20%3D%20_ax.scatter(%0A%20%20%20%20%20%20%20%20_fl%5B%22longitude%22%5D%2C%20_fl%5B%22latitude%22%5D%2C%20s%3D3%2C%0A%20%20%20%20%20%20%20%20c%3Dnp.clip(_fl%5B%22surge%22%5D%2C%200%2C%208)%2C%20cmap%3D%22YlGnBu%22%2C%20vmin%3D0%2C%20vmax%3D8%2C%20linewidths%3D0%2C%0A%20%20%20%20)%0A%20%20%20%20_cb%20%3D%20_fig.colorbar(_sc%2C%20ax%3D_ax%2C%20shrink%3D0.6%2C%20pad%3D0.02)%0A%20%20%20%20_cb.set_label(%22surge%20above%20ground%20(ft)%20%20%5Bclipped%20at%208%5D%22)%0A%20%20%20%20for%20_z%20in%20%5B%2233713%22%2C%20%2233710%22%2C%20%2233707%22%2C%20%2233711%22%2C%20%2233701%22%2C%20%2233703%22%2C%20%2233704%22%5D%3A%0A%20%20%20%20%20%20%20%20_s%20%3D%20_m%5B_m%5B%22zip%22%5D%20%3D%3D%20_z%5D%0A%20%20%20%20%20%20%20%20if%20len(_s)%20%3E%2050%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20_ax.text(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20_s%5B%22longitude%22%5D.median()%2C%20_s%5B%22latitude%22%5D.median()%2C%20_z%2C%20fontsize%3D8%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fontweight%3D%22bold%22%2C%20ha%3D%22center%22%2C%20color%3D%22%23222%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20bbox%3Ddict(boxstyle%3D%22round%2Cpad%3D0.15%22%2C%20fc%3D%22white%22%2C%20ec%3D%22none%22%2C%20alpha%3D0.7)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20_ax.set_aspect(1%20%2F%20np.cos(np.radians(27.77)))%20%20%23%20equal-distance%20aspect%20at%20St-Pete%20latitude%0A%20%20%20%20_ax.set_xlabel(%22longitude%22)%0A%20%20%20%20_ax.set_ylabel(%22latitude%22)%0A%20%20%20%20_ax.set_title(%0A%20%20%20%20%20%20%20%20f%22Modeled%202024%20surge%20above%20ground%20%E2%80%94%20St-Pete%20SFR%5Cn%22%0A%20%20%20%20%20%20%20%20f%22%7Blen(_fl)%3A%2C%7D%20inundated%20(colored)%20of%20%7Blen(_m)%3A%2C%7D%3B%20dry%20in%20gray%20%20%E2%80%A2%20%20~8.9%20ft%20NAVD88%20planar%20stillwater%22%0A%20%20%20%20)%0A%20%20%20%20_fig.tight_layout()%0A%20%20%20%20mo.vstack(%5B_fig%2C%20mo.md(%0A%20%20%20%20%20%20%20%20%22**Where%20it%20floods%2C%20mapped.**%20Gray%20%3D%20dry%3B%20colored%20%3D%20inundated%20(darker%20%3D%20deeper).%20%22%0A%20%20%20%20%20%20%20%20%22Because%20the%20stillwater%20surface%20is%20a%20near-planar%20~8.9%20ft%20NAVD88%20plane%2C%20this%20is%20%22%0A%20%20%20%20%20%20%20%20%22effectively%20a%20ground-elevation%20map%20thresholded%20at%20the%20water%20level%3A%20the%20**33713%2F33710%20%22%0A%20%20%20%20%20%20%20%20%22ridge**%20stays%20dry%20through%20the%20city's%20core%20while%20the%20low%20coastal%2Fpeninsular%20edges%20carry%20%22%0A%20%20%20%20%20%20%20%20%22the%20surge.%20Trust%20the%20spatial%20*pattern*%20over%20the%20exact%20per-parcel%20depth%20%E2%80%94%20a%20real%202024%20%22%0A%20%20%20%20%20%20%20%20%22depth%20grid%20would%20refine%20the%20latter.%22%0A%20%20%20%20)%5D)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(hwm%2C%20mo)%3A%0A%20%20%20%20%23%20Rung%20A%3A%20HWM-derived%20surface%20vs.%20the%20NOAA%20St.%20Petersburg%20tide-gauge%20peak.%0A%20%20%20%20NOAA_PEAK_FT_MHHW%20%3D%206.31%20%20%20%20%20%20%20%20%23%20Helene%20peak%20above%20MHHW%20at%20the%20St.%20Pete%20gauge%0A%20%20%20%20MHHW_TO_NAVD88_OFFSET%20%3D%201.1%20%20%20%20%20%23%20approx%20local%20offset%20ft%20(MHHW%20is%20~1.1%20ft%20above%20NAVD88)%0A%20%20%20%20noaa_navd88_approx%20%3D%20NOAA_PEAK_FT_MHHW%20%2B%20MHHW_TO_NAVD88_OFFSET%0A%20%20%20%20hwm_median%20%3D%20hwm%5B%22elevation_navd88_ft%22%5D.median()%0A%20%20%20%20hwm_max%20%3D%20hwm%5B%22elevation_navd88_ft%22%5D.max()%0A%20%20%20%20hwm_min%20%3D%20hwm%5B%22elevation_navd88_ft%22%5D.min()%0A%20%20%20%20agreement_ft%20%3D%20hwm_median%20-%20noaa_navd88_approx%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%23%23%23%20Ladder%20rung%20A%20%E2%80%94%20hazard%20footprint%20cross-check%0A%0A%20%20%20%20**Regional%20HWM%20elevations%20(NAVD88%20ft)%3A**%20median%20**%7Bhwm_median%3A.1f%7D**%2C%20range%0A%20%20%20%20**%7Bhwm_min%3A.1f%7D%E2%80%93%7Bhwm_max%3A.1f%7D**%2C%20n%20%3D%20**%7Blen(hwm)%7D**%20marks%20(Helene%20%2B%20Milton%0A%20%20%20%20combined%2C%20spanning%20the%20Tampa%20Bay%20region).%0A%0A%20%20%20%20**NOAA%20St.%20Petersburg%20gauge%20cross-check%3A**%20Helene%20peak%20~**%7BNOAA_PEAK_FT_MHHW%7D%20ft**%0A%20%20%20%20above%20MHHW%20%E2%89%88%20**~%7Bnoaa_navd88_approx%3A.1f%7D%20ft%20NAVD88**%20(using%20local%20MHHW%E2%86%92NAVD88%0A%20%20%20%20offset%20%E2%89%88%20%7BMHHW_TO_NAVD88_OFFSET%7D%20ft).%0A%0A%20%20%20%20**Agreement%3A**%20regional%20HWM%20median%20is%20**%7Bagreement_ft%3A%2B.1f%7D%20ft**%20relative%20to%20the%0A%20%20%20%20gauge%20cross-check.%20%20The%20HWM%20surface%20sits%20slightly%20above%20the%20harbour%20gauge%2C%20consistent%0A%20%20%20%20with%20higher%20surge%20on%20open-bay%20and%20low-lying%20areas%20vs.%20the%20sheltered%20gauge%20location.%0A%20%20%20%20Both%20are%20in%20the%20same%20~8%E2%80%939%20ft%20NAVD88%20band%20%E2%80%94%20**surface%20is%20in-band%2C%20not%20orders%20of%0A%20%20%20%20magnitude%20off**.%20%20The%20near-planar%20character%20reflects%20HWM%20sparsity%20(regional%20IDW%20with%0A%20%20%20%20a%2060%20km%20cap)%2C%20consistent%20with%20spec%20assumption%20%235.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(losses%2C%20mo)%3A%0A%20%20%20%20%23%20Rung%20B%3A%20modeled%20count%20of%20damaged%20homes%20vs.%20public%20county%20aggregate%20counts.%0A%20%20%20%20%23%20Public%20figures%20(county%2Fnews)%3A%20~28%2C350%20homes%20damaged%20in%20Helene%2C%20~12%2C560%20in%20Milton.%0A%20%20%20%20COUNTY_HELENE_DAMAGED%20%3D%2028_350%0A%20%20%20%20COUNTY_MILTON_DAMAGED%20%3D%2012_560%0A%20%20%20%20DAMAGE_THRESHOLD%20%3D%200.05%20%20%23%20%3E%3D5%25%20structure%20damage%20counts%20as%20%22damaged%22%0A%20%20%20%20modeled_damaged%20%3D%20int((losses%5B%22structure_damage_ratio%22%5D%20%3E%3D%20DAMAGE_THRESHOLD).sum())%0A%20%20%20%20mo.md(f%22%22%22%0A%20%20%20%20%23%23%23%20Ladder%20rung%20B%20%E2%80%94%20damage%20scale%0A%0A%20%20%20%20Modeled%20St-Pete%20SFR%20with%20%3E%3D%20%7BDAMAGE_THRESHOLD%3A.0%25%7D%20structure%20damage%3A%0A%20%20%20%20**%7Bmodeled_damaged%3A%2C%7D**.%20County-wide%20public%20counts%20span%20both%20storms%20and%20all%20property%0A%20%20%20%20types%20(Helene%20~%7BCOUNTY_HELENE_DAMAGED%3A%2C%7D%3B%20Milton%20~%7BCOUNTY_MILTON_DAMAGED%3A%2C%7D)%20%E2%80%94%20St-Pete%0A%20%20%20%20SFR%20is%20a%20subset%2C%20so%20expect%20the%20modeled%20number%20to%20be%20a%20fraction%20of%20these%2C%20same%20order%20of%0A%20%20%20%20magnitude.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(bg_takeup%2C%20conn%2C%20plt)%3A%0A%20%20%20%20%23%20Rung%20C%20(PRIMARY)%3A%20modeled%20insured%20loss%20vs.%20realized%202024%20NFIP%20claims%2C%20by%20block%20group.%0A%20%20%20%20%23%20Now%20DE-CONFOUNDED%3A%20alongside%20the%20100%25-take-up%20series%2C%20a%20take-up-adjusted%20series%0A%20%20%20%20%23%20(from%20the%20shared%20bg_takeup%20frame)%20is%20comparable%20to%20realized%20payouts%2C%20which%20only%0A%20%20%20%20%23%20flow%20to%20insured%20homes.%0A%20%20%20%20claims%20%3D%20conn.execute(%0A%20%20%20%20%20%20%20%20%22SELECT%20block_group%2C%20total_paid%20AS%20actual_paid%20FROM%20flood_claims_bg%20WHERE%20year%20%3D%202024%22%0A%20%20%20%20).fetchdf()%0A%20%20%20%20comp%20%3D%20bg_takeup.merge(claims%2C%20on%3D%22block_group%22%2C%20how%3D%22inner%22)%0A%20%20%20%20comp%20%3D%20comp%5Bcomp%5B%22actual_paid%22%5D%20%3E%200%5D%0A%0A%20%20%20%20fig_rungc%2C%20ax_rungc%20%3D%20plt.subplots(figsize%3D(6%2C%206))%0A%20%20%20%20ax_rungc.scatter(comp%5B%22actual_paid%22%5D%20%2F%201e6%2C%20comp%5B%22insured_loss%22%5D%20%2F%201e6%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20alpha%3D0.4%2C%20label%3D%22modeled%20%40%20100%25%20take-up%22)%0A%20%20%20%20ax_rungc.scatter(comp%5B%22actual_paid%22%5D%20%2F%201e6%2C%20comp%5B%22insured_loss_takeup%22%5D%20%2F%201e6%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20alpha%3D0.6%2C%20marker%3D%22x%22%2C%20c%3D%22%23C44E52%22%2C%20label%3D%22modeled%20%40%20est.%20take-up%22)%0A%20%20%20%20if%20len(comp)%20%3E%200%3A%0A%20%20%20%20%20%20%20%20lim%20%3D%20comp%5B%5B%22actual_paid%22%2C%20%22insured_loss%22%2C%20%22insured_loss_takeup%22%5D%5D.max().max()%20%2F%201e6%0A%20%20%20%20%20%20%20%20ax_rungc.plot(%5B0%2C%20lim%5D%2C%20%5B0%2C%20lim%5D%2C%20%22k--%22%2C%20lw%3D1%2C%20label%3D%221%3A1%22)%0A%20%20%20%20ax_rungc.set_xlabel(%22realized%202024%20NFIP%20paid%20(%24M)%22)%0A%20%20%20%20ax_rungc.set_ylabel(%22modeled%20NFIP%20insured%20loss%20(%24M)%22)%0A%20%20%20%20ax_rungc.set_title(%22Rung%20C%20%E2%80%94%20modeled%20vs.%20realized%20insured%20loss%20by%20block%20group%22)%0A%20%20%20%20ax_rungc.legend()%0A%20%20%20%20paid%20%3D%20comp%5B%22actual_paid%22%5D.sum()%0A%20%20%20%20ratio%20%3D%20comp%5B%22insured_loss%22%5D.sum()%20%2F%20paid%20if%20paid%20%3E%200%20else%20float(%22nan%22)%0A%20%20%20%20ratio_takeup%20%3D%20comp%5B%22insured_loss_takeup%22%5D.sum()%20%2F%20paid%20if%20paid%20%3E%200%20else%20float(%22nan%22)%0A%20%20%20%20return%20comp%2C%20fig_rungc%2C%20ratio%2C%20ratio_takeup%0A%0A%0A%40app.cell%0Adef%20_(comp%2C%20fig_rungc%2C%20mo%2C%20ratio%2C%20ratio_takeup)%3A%0A%20%20%20%20mo.vstack(%5Bfig_rungc%2C%20mo.md(%0A%20%20%20%20%20%20%20%20f%22**Primary%20loss%20check%20(de-confounded).**%20Across%20%7Blen(comp)%7D%20block%20groups%20with%20%22%0A%20%20%20%20%20%20%20%20f%22realized%202024%20NFIP%20payouts%3A%5Cn%5Cn%22%0A%20%20%20%20%20%20%20%20f%22-%20modeled%20**%40%20100%25%20take-up**%20%2F%20realized%20%3D%20**%7Bratio%3A.2f%7D%C3%97**%20(the%20old%20confounded%20headline)%5Cn%22%0A%20%20%20%20%20%20%20%20f%22-%20modeled%20**%40%20estimated%20take-up**%20%2F%20realized%20%3D%20**%7Bratio_takeup%3A.2f%7D%C3%97**%5Cn%5Cn%22%0A%20%20%20%20%20%20%20%20%22Scaling%20modeled%20loss%20by%20per-BG%20policies-in-force%20collapses%20most%20of%20the%20~2%C3%97%20gap%20%22%0A%20%20%20%20%20%20%20%20%22toward%201%3A1%20%E2%80%94%20turning%20*%5C%22the%202.11%C3%97%20is%20just%20take-up%5C%22*%20from%20a%20narrative%20into%20a%20%22%0A%20%20%20%20%20%20%20%20%22measured%20result.%20Residual%20deviation%20is%20real%20model%20error%20(planar%20hazard%20surface%2C%20%22%0A%20%20%20%20%20%20%20%20%22FFH%2C%20SFR-only%20vs.%20NFIP's%20condos%2Fcommercial)%2C%20not%20the%20take-up%20confound.%22%0A%20%20%20%20)%5D)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%23%23%23%20Ladder%20rung%20D%20%E2%80%94%20independent%20zip%20cross-check%20(verify%20fields%20during%20build)%0A%0A%20%20%20%20OpenFEMA%20**Individual%20Assistance**%20(%60IndividualsAndHouseholdsProgramValidRegistrations%60)%0A%20%20%20%20verified%20real-property%20loss%20by%20zip%20is%20an%20insurance-independent%20cross-check.%20*Verify%20the%0A%20%20%20%20exact%20field%20names%20against%20the%20OpenFEMA%20API%20before%20wiring%20this%20in%3B*%20fold%20a%20modeled-vs-IA%0A%20%20%20%20scatter%20by%20zip%20in%20here%20once%20confirmed.%0A%0A%20%20%20%20%23%23%23%20Ladder%20rung%20E%20%E2%80%94%20parcel-level%20damage%20assessment%20(stretch%2C%20outreach-pending)%0A%0A%20%20%20%20Pinellas%20County%20parcel-level%20Damage%20Assessment%20(affected%2Fminor%2Fmajor%2Fdestroyed)%20is%20the%0A%20%20%20%20ideal%20validator%20%E2%80%94%20**independent%20of%20insurance%20take-up**%20%E2%80%94%20but%20is%20not%20anonymously%0A%20%20%20%20downloadable.%20Request%20from%20Pinellas%20eGIS%20(egis%40pinellascounty.org%20%2F%20727-582-3447)%3B%0A%20%20%20%20fold%20in%20if%20it%20arrives.%20Built%20without%20it.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(%0A%20%20%20%20MAX_DIST_KM%2C%0A%20%20%20%20conn%2C%0A%20%20%20%20curve%2C%0A%20%20%20%20exposure%2C%0A%20%20%20%20financial%2C%0A%20%20%20%20hazard%2C%0A%20%20%20%20pd%2C%0A%20%20%20%20vulnerability%2C%0A)%3A%0A%20%20%20%20%23%20Sweep%20the%20two%20high-leverage%20assumptions%3B%20report%20portfolio%20insured%20loss%20response.%0A%20%20%20%20def%20_portfolio_loss(*%2C%20ffh_slab_ft%3D1.0%2C%20cost_per_sqft%3D180.0)%20-%3E%20float%3A%0A%20%20%20%20%20%20%20%20e%20%3D%20exposure.load_exposure(conn%2C%20ffh_slab_ft%3Dffh_slab_ft%2C%20cost_per_sqft%3Dcost_per_sqft)%0A%20%20%20%20%20%20%20%20hwm_s%20%3D%20hazard.load_hwm(conn)%0A%20%20%20%20%20%20%20%20h%20%3D%20hazard.assign_flood_depth(e%2C%20hwm_s%2C%20max_dist_km%3DMAX_DIST_KM)%0A%20%20%20%20%20%20%20%20v%20%3D%20vulnerability.apply_vulnerability(h%2C%20curve)%0A%20%20%20%20%20%20%20%20return%20financial.apply_financial(v)%5B%22insured_loss%22%5D.sum()%0A%0A%20%20%20%20ffh_sweep%20%3D%20pd.DataFrame(%7B%0A%20%20%20%20%20%20%20%20%22ffh_ft%22%3A%20%5B0.5%2C%201.0%2C%201.5%2C%202.0%2C%202.5%2C%203.0%5D%2C%0A%20%20%20%20%7D)%0A%20%20%20%20ffh_sweep%5B%22insured_loss_%24M%22%5D%20%3D%20%5B%0A%20%20%20%20%20%20%20%20round(_portfolio_loss(ffh_slab_ft%3Dx)%20%2F%201e6%2C%201)%20for%20x%20in%20ffh_sweep%5B%22ffh_ft%22%5D%0A%20%20%20%20%5D%0A%20%20%20%20rcv_sweep%20%3D%20pd.DataFrame(%7B%0A%20%20%20%20%20%20%20%20%22cost_per_sqft%22%3A%20%5B150%2C%20175%2C%20200%2C%20225%2C%20250%5D%2C%0A%20%20%20%20%7D)%0A%20%20%20%20rcv_sweep%5B%22insured_loss_%24M%22%5D%20%3D%20%5B%0A%20%20%20%20%20%20%20%20round(_portfolio_loss(cost_per_sqft%3Dx)%20%2F%201e6%2C%201)%20for%20x%20in%20rcv_sweep%5B%22cost_per_sqft%22%5D%0A%20%20%20%20%5D%0A%20%20%20%20return%20ffh_sweep%2C%20rcv_sweep%0A%0A%0A%40app.cell%0Adef%20_(ffh_sweep%2C%20mo%2C%20plt%2C%20rcv_sweep)%3A%0A%20%20%20%20fig_sweep%2C%20(a1%2C%20a2)%20%3D%20plt.subplots(1%2C%202%2C%20figsize%3D(11%2C%204))%0A%20%20%20%20a1.plot(ffh_sweep%5B%22ffh_ft%22%5D%2C%20ffh_sweep%5B%22insured_loss_%24M%22%5D%2C%20%22o-%22)%0A%20%20%20%20a1.set_xlabel(%22first-floor%20height%20(ft)%22)%0A%20%20%20%20a1.set_ylabel(%22portfolio%20insured%20loss%20(%24M)%22)%0A%20%20%20%20a1.set_title(%22FFH%20sweep%20(expected%3A%20steepest%20response)%22)%0A%20%20%20%20a2.plot(rcv_sweep%5B%22cost_per_sqft%22%5D%2C%20rcv_sweep%5B%22insured_loss_%24M%22%5D%2C%20%22s-%22%2C%20color%3D%22%23C44E52%22)%0A%20%20%20%20a2.set_xlabel(%22replacement%20cost%20(%24%2Fsqft)%22)%0A%20%20%20%20a2.set_title(%22RCV%20sweep%20(expected%3A%20~linear)%22)%0A%20%20%20%20mo.vstack(%5Bfig_sweep%2C%20mo.md(%0A%20%20%20%20%20%20%20%20%22**Sensitivity%20is%20a%20deliverable%2C%20not%20a%20point%20estimate.**%20FFH%20is%20expected%20to%20be%20the%20%22%0A%20%20%20%20%20%20%20%20%22steepest%20response%20(depth-damage%20curves%20are%20steepest%20in%20the%20first%201-2%20ft)%3B%20RCV%20%22%0A%20%20%20%20%20%20%20%20%22scales%20loss%20roughly%20linearly.%20'Start%20with%20a%20default%2C%20modify%20later'%20is%20built%20in.%22%0A%20%20%20%20)%5D)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(conn%2C%20curve%2C%20exp%2C%20financial%2C%20hazard%2C%20np%2C%20pd%2C%20vulnerability)%3A%0A%20%20%20%20%23%20Hazard-source%20comparison%3A%20near-planar%20HWM-IDW%20surface%20vs.%20NHC%20SLOSH%20inundation%20grid.%0A%20%20%20%20%23%20The%20SLOSH%20grid%20(data%2Fslosh%2F%2C%20built%20by%20ingest_slosh_inundation.py)%20is%20a%20model-derived%0A%20%20%20%20%23%20WORST-CASE%20forecast%20(NHC%20P-Surge%2C%20~10%25%20exceedance)%20%E2%80%94%20see%20data%2Fslosh%2FSOURCE.md.%20It%20is%20a%0A%20%20%20%20%23%20COMPARISON%20layer%2C%20not%20ground%20truth%3B%20absolute%20depths%20are%20an%20upper%20bound.%0A%20%20%20%20_xw%20%3D%20conn.execute(%22SELECT%20parcel_id%2C%20block_group%20FROM%20parcel_block_group%22).fetchdf()%0A%20%20%20%20_cl%20%3D%20conn.execute(%22SELECT%20block_group%2C%20total_paid%20AS%20actual_paid%20FROM%20flood_claims_bg%20WHERE%20year%3D2024%22).fetchdf()%0A%20%20%20%20_SLOSH%20%3D%20%22data%2Fslosh%2Fstpete_slosh_inundation_depth_ft.tif%22%0A%0A%20%20%20%20def%20_row(label%2C%20haz)%3A%0A%20%20%20%20%20%20%20%20los%20%3D%20financial.apply_financial(vulnerability.apply_vulnerability(haz%2C%20curve))%0A%20%20%20%20%20%20%20%20bg%20%3D%20los.merge(_xw%2C%20on%3D%22parcel_id%22).groupby(%22block_group%22%2C%20as_index%3DFalse)%5B%22insured_loss%22%5D.sum()%0A%20%20%20%20%20%20%20%20comp%20%3D%20bg.merge(_cl%2C%20on%3D%22block_group%22)%3B%20comp%20%3D%20comp%5Bcomp.actual_paid%20%3E%200%5D%0A%20%20%20%20%20%20%20%20rc%20%3D%20comp.insured_loss.sum()%20%2F%20comp.actual_paid.sum()%0A%20%20%20%20%20%20%20%20rank%20%3D%20np.corrcoef(comp.insured_loss.rank()%2C%20comp.actual_paid.rank())%5B0%2C%201%5D%0A%20%20%20%20%20%20%20%20return%20%7B%22source%22%3A%20label%2C%20%22flooded%20parcels%22%3A%20int((los.depth_ft%20%3E%200).sum())%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22insured%20%40100%25%20(%24M)%22%3A%20round(los.insured_loss.sum()%20%2F%201e6)%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22rung-C%20%40100%25%22%3A%20round(rc%2C%202)%2C%20%22rank-corr%20vs%20claims%22%3A%20round(rank%2C%202)%7D%0A%0A%20%20%20%20hazard_compare%20%3D%20pd.DataFrame(%5B%0A%20%20%20%20%20%20%20%20_row(%22Planar%20(HWM-IDW%2060km)%22%2C%20hazard.assign_flood_depth(exp%2C%20hazard.load_hwm(conn)%2C%20max_dist_km%3D60))%2C%0A%20%20%20%20%20%20%20%20_row(%22SLOSH%20grid%20(worst-case)%22%2C%20hazard.assign_flood_depth_from_grid(exp%2C%20_SLOSH))%2C%0A%20%20%20%20%5D)%0A%20%20%20%20return%20(hazard_compare%2C)%0A%0A%0A%40app.cell%0Adef%20_(hazard_compare%2C%20mo)%3A%0A%20%20%20%20mo.vstack(%5Bhazard_compare%2C%20mo.md(%0A%20%20%20%20%20%20%20%20%22**Hazard-source%20comparison%20(the%20Phase-1.5%20hazard%20finding).**%20The%20NHC%20SLOSH%20grid%20%22%0A%20%20%20%20%20%20%20%20%22floods%20*far%20fewer*%20parcels%20and%20yields%20*less*%20loss%20than%20the%20planar%20surface%20%E2%80%94%20it%20%22%0A%20%20%20%20%20%20%20%20%22constrains%20inundation%20to%20surge-reachable%20coastal%20areas%2C%20where%20the%20bathtub%20plane%20%22%0A%20%20%20%20%20%20%20%20%22over-floods%20every%20low-lying%20inland%20parcel%20below%20the%20waterline.%20Aggregate%20rung-C%20%22%0A%20%20%20%20%20%20%20%20%22lands%20near%201%3A1%20at%20100%25%20take-up%20(vs%202.14x%20planar)%2C%20but%20spatial%20rank-correlation%20with%20%22%0A%20%20%20%20%20%20%20%20%22claims%20is%20marginally%20lower.%20A%20genuine%20tradeoff%20(better%20absolute%20calibration%2C%20%22%0A%20%20%20%20%20%20%20%20%22slightly%20worse%20spatial%20rank)%2C%20not%20a%20clean%20win%20%E2%80%94%20expected%20for%20a%20worst-case%20*forecast*%20%22%0A%20%20%20%20%20%20%20%20%22footprint%20rather%20than%20an%20observed%2Fbest-estimate%20one.%20See%20%60data%2Fslosh%2FSOURCE.md%60.%22%0A%20%20%20%20)%5D)%0A%20%20%20%20return%0A%0A%0A%40app.cell%0Adef%20_(mo)%3A%0A%20%20%20%20mo.md(%22%22%22%0A%20%20%20%20%23%23%20Verdict%0A%0A%20%20%20%20The%20deterministic%20model%20reproduces%20the%20*shape*%20and%20*order%20of%20magnitude*%20of%202024%3A%0A%20%20%20%20coastal%20block%20groups%20carry%20the%20loss%2C%20the%20ridge%20contributes%20~zero%2C%20and%20modeled%20insured%0A%20%20%20%20loss%20tracks%20realized%20NFIP%20payouts%20(rung%20C)%20within%20the%20band%20expected%20given%20take-up%0A%20%20%20%20confounding.%20The%20reusable%20engine%20(%60analysis%2Fcatmodel%2F%60)%20carries%20forward%20to%20Phase%202%0A%20%20%20%20(stochastic%20catalog%20-%3E%20EP%20curve%2C%20AAL%2C%20PML)%20with%20only%20the%20hazard%20input%20swapped%20%E2%80%94%20and%20the%0A%20%20%20%20hazard%20layer%20now%20supports%20both%20an%20HWM-IDW%20surface%20and%20a%20sampled%20depth%20grid.%0A%20%20%20%20%22%22%22)%0A%20%20%20%20return%0A%0A%0Aif%20__name__%20%3D%3D%20%22__main__%22%3A%0A%20%20%20%20app.run()%0A
b6057cc94bcfe0df93339d72132b6e03