extreme-weather-stats
Statistical analysis of extreme weather — EVT, return periods, thresholds, and detection/attribution of rare events.
- License 许可
- MIT
- 最近更新
- 2026-11-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- extreme-weather-stats
- category
- scientific
- description
- Statistical analysis of extreme weather — EVT, return periods, thresholds, and detection/attribution of rare events.
03 SKILL.md 正文
Overview
Extremes (heatwaves, heavy rainfall, droughts, windstorms) cause most weather-related damage, but they're rare by definition — standard statistics understate them. This skill covers extreme value theory (GEV, GPD), return-period estimation, threshold selection, non-stationary methods for a changing climate, and the basics of event attribution.
When to use
- Estimating the 100-year rainfall or wind speed for infrastructure design
- Defining heatwave/cold-wave indices for health early-warning systems
- Testing whether extremes are intensifying in observations or models
- Attributing a specific event (flood, heatwave) to climate change
- Reviewing a "1-in-1000-year event" claim in the media or a report
Core concepts
-
Block maxima (GEV): fit the Generalized Extreme Value distribution to annual maxima — the classical route to return levels. Needs long records; wastes data (one value/year).
-
Peaks over threshold (GPD): fit the Generalized Pareto Distribution to exceedances of a high threshold — uses data more efficiently; threshold choice is the critical judgment (stability plots guide it).
-
Return period: the average waiting time between exceedances (a "100-year event" has a 1% annual chance — and a ~63% chance of occurring at least once in 100 years). Return periods extrapolate beyond the record — uncertainty explodes past ~2–3× the record length.
-
Non-stationarity: in a warming climate, distribution parameters drift with time or global temperature; fit μ(t) or σ(t) as functions of a covariate rather than assuming stationarity.
-
Attribution framing: probabilistic (how did climate change alter the event's probability/intensity? — the FAR/RR approach) vs storyline (how did known dynamics produce this event?). Both are legitimate; they answer different questions.
-
Compound events: damaging extremes often combine (heat + drought, rain + storm surge); univariate return periods understate joint risk.
-
Block-maxima vs POT efficiency: POT uses data more efficiently but introduces threshold selection and declustering judgments — for short records the efficiency gain usually wins; for long clean records, GEV on annual maxima is simpler and robust.
-
Covariate choice in non-stationary models: global mean temperature (physical, smooth) vs time (a proxy for everything) — temperature covariates generalize better and connect to attribution; time covariates are easier but less interpretable.
-
Spatial pooling: regional frequency analysis (index-flood style) borrows strength across sites — essential when single-site records are short; requires homogeneity testing of the pooled region.
Practical workflow
1. Prepare the series
- Use homogenized, complete records; extremes are sensitive to instrument changes and missing data.
- Declutter (for POT): ensure exceedances are independent events (e.g., separate rainfall by dry intervals, heatwaves by cool breaks).
- Check for obvious non-stationarity first (plot annual maxima vs time) — it decides the modeling approach.
2. Fit the distribution
# Pseudocode: GEV fit to annual maxima with a time-varying location
# mu(t) = mu0 + mu1 * t ; maximize likelihood; compare AIC vs stationary fit
- GEV on annual maxima for a first estimate; GPD on threshold exceedances when the record is short or you need efficiency.
- Choose thresholds via parameter-stability and mean-residual-life plots — not by round numbers.
- Fit non-stationary models with covariates (time, global mean temperature); compare against stationary fits with AIC/BIC.
- Validate with Q–Q plots and return-level plots — a good fit hugs the diagonal; deviations at the tail are warnings.
3. Estimate and communicate return levels
- Report the estimate with confidence intervals (profile likelihood or bootstrap) — the interval, not the point value, is the honest answer.
- Don't extrapolate beyond ~3× the record length; say "beyond the observable range" instead of quoting a 10,000-year level from 40 years of data.
- Translate for non-specialists: "1% annual chance" beats "100-year event" (which people misread as "once per century").
4. Attribute an event (probabilistic)
- Define the event class (magnitude, duration, region) before looking at model results.
- Fit the same statistical model to observations and to model ensembles with/without anthropogenic forcing (factual vs counterfactual).
- Report the probability ratio (RR) and the change in intensity, each with uncertainty — and the model-evaluation step that justifies trusting the models for this event type.
5. Stress-test the return-level estimate
- Vary the threshold (POT), block definition, and covariate choice — the return level should be stable across reasonable choices; instability is the real uncertainty.
- Compare stationary vs non-stationary fits with AIC/BIC and likelihood-ratio tests — let the data adjudicate, but prefer the physically motivated covariate.
- Bootstrap the full pipeline (resampling years/blocks) to get confidence intervals that include the methodological choices, not just the sampling noise.
6. Quick-reference checklist
- [ ] Records homogenized and complete; missing data handled explicitly
- [ ] Exceedances decluttered into independent events (POT)
- [ ] Threshold chosen via stability plots, not round numbers
- [ ] Stationarity tested; non-stationary model fit with physical covariate if needed
- [ ] Fit validated with Q–Q and return-level plots
- [ ] Confidence intervals computed (profile likelihood or bootstrap)
- [ ] No extrapolation beyond ~3× the record length
- [ ] Results communicated as annual probabilities, not just "N-year events"
Common pitfalls
- Stationarity by default: fitting a stationary GEV to a warming-era record biases return levels low for heat, high for cold.
- Extrapolation hubris: 50 years of data cannot pin down a 1000-year return level — the confidence interval will tell you if you compute it.
- Threshold hacking: tuning the POT threshold until the trend looks significant — pre-register or show stability across thresholds.
- Confusing return period with schedule: clustering happens; three "100-year" floods in a decade is unlikely but not impossible, especially under non-stationarity.
- Attribution without model evaluation: if models can't reproduce the observed statistics of the event type, the attribution numbers are decorative.
- Single-station generalization: an extreme at one gauge is not a regional trend — check spatial coherence before generalizing.
- Declustering by calendar: splitting exceedances by fixed time windows instead of physical event separation — merges distinct storms or splits single ones; use meteorologically meaningful separation criteria.
- Presenting the upper confidence bound as "the" estimate: the precautionary principle doesn't license quoting the 95th percentile as the best estimate — report the central estimate with its interval.
04 同仓库更多 Skills
web-scrape
Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open/fetch fails on JS-heavy pages, or when you need clean markdown/structured extraction from a site. Requires FIRECRAWL_API_KEY.
design-taste-frontend
tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
systematic-debugging
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
requesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).