Casts build_peril_probabilities() output wide and merges it into a pseudo-producer panel. Causes never observed anywhere (all-zero loss cost) are dropped; cause names are slugified (lowercase, non-alphanumerics to _, so "Excess Moisture|pp" becomes excess_moisture_pp). Both poolings attach: year-specific columns (occurrence_<slug>_yr, severity_<slug>_yr, joined on cell keys + commodity_year) and climatology columns (_clim, joined on cell keys alone). Panel rows whose source levels carry no attributed experience get zeros.

attach_peril_probabilities(panel, probs)

Arguments

panel

A pseudo-producer panel from build_agent_panel().

probs

Output of build_peril_probabilities().

Value

The panel with the wide peril columns appended.