Mini Project 2: Extremes and Model Comparison

BEE 4850/5850, Spring 2027

ImportantDue Date

Friday, 5/07/27, 9:00pm

If you are enrolled in the course, fork the project repository (linked on Ed Discussion) to your own GitHub account and clone your fork. That gives you the package environment and a repository you can use to share code if you need help. Otherwise you are responsible for setting up an equivalent environment in the language of your choosing. Make sure to include your name and NetID on your solution.

Overview

Instructions

This is the second mini project. You may work individually or in pairs.

You are given a century of flood peaks from a single river gauge. The question is what the largest flood you should plan for is, and how much of your answer is a property of the river rather than of the choices you made along the way.

Unlike the homework, this is not a set of numbered problems. You are given a question and a required method, and you decide how to build and present the argument.

By the time this is due you will have seen cross-validation, KL divergence, AIC, WAIC and BIC. This project is where you find out that they do not all answer the same question.

Load Environment

The following code loads the environment and makes sure all needed packages are installed. This should be at the start of most Julia scripts.

import Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
using Random # random number generation and seed-setting
using DataFrames # tabular data structure
using CSV # reads/writes .csv files
using Distributions # interface to work with probability distributions
using Optim # numerical optimization, for maximum likelihood
using StatsBase # summary statistics
using Plots # plotting library
using LaTeXStrings # nicer LaTeX labels for plots

The Data

USGS gauge 03339000, Vermilion River near Danville, Illinois. Three files:

File What
data/vermilion_peaks.csv Instantaneous annual peak discharge, cfs, 1915–2025
data/vermilion_daily.csv Daily mean discharge, cfs, 1914–2025
data/vermilion_posterior.csv A posterior sample, described below
peaks = CSV.read("data/vermilion_peaks.csv", DataFrame)
daily = CSV.read("data/vermilion_daily.csv", DataFrame)
WarningThe record has holes in it, and that is the assignment

Years are missing from the peak record, including a run of them in the 1920s when the gauge was not operating. Some years appear in the daily record but not the peak record. Some years are present in the daily record but only partly.

Flood frequency analysis is conventionally done on instantaneous annual peaks, which is what vermilion_peaks.csv holds. What you do about the years that are absent, partial, or inconsistent between the two files is a modelling decision you have to make and defend — not a cleaning step to get past.

What You Are Asked To Do

What is the 100-year flood on this river, and how much of your answer comes from the river rather than from your choices?

Answer it by fitting a GEV to annual maxima and a GPD to peaks over a threshold, each in a stationary and a non-stationary form — four models — and comparing them on evidence.

How you organize the writeup is up to you. There are no numbered problems. You are writing a short report that makes one argument and shows the evidence behind it.

What your report must contain

Your report is graded on whether these are present and convincing, not on whether they appear in this order or under these headings.

  • A defended decision about which record you are analysing (10 points — Specifying a Model). Which years you used, what you did about the absent and partial ones, and why. Say what a reader would have to believe for your choice to be the right one.
  • Four fitted models (10 points — Fitting and Recovery). GEV and GPD, each stationary and non-stationary. State your threshold and declustering rule for the GPD and justify both. Likelihoods written by hand.
  • A comparison within each family (12 points — Model Comparison). Use AIC, BIC and WAIC, and say for each what quantity it is estimating. If they disagree, the disagreement is the finding, not an obstacle — explain what it tells you.
  • An account of why you cannot use those criteria to choose between the GEV and the GPD (10 points — Interpretation), and a comparison of the two that is defensible instead.
  • A 100-year return level with honest uncertainty (8 points — Interpretation), and a statement of what this record can and cannot support. If you do not believe your own interval, say so and say why.

50 points total. The point value beside each element is what it is worth; the standard rubrics describe how each kind of element is marked.

Form

No more than five pages excluding figures and references. You do not need to include code, but your notebook or scripts must be in your repository. Raw program output is not an answer to anything — write in sentences.

Important“AIC and BIC disagree” is not a conclusion

Reporting that the criteria disagree and stopping there earns nothing for that element. They disagree because they are estimating different things. Saying which, and what follows for the decision you are being asked to make, is the entire point.

TipHow much record should you use?

The answer you get may depend on how many years you analyse. That is not a bug in your analysis — it is information about how much this record can support. If two defensible choices give different answers, report both.

NoteThe provided posterior sample

data/vermilion_posterior.csv holds draws from the posterior of several GEV variants, fitted to these peaks. Columns: record, model, draw, and the parameters mu0, log_sigma0, xi, mu1, sigma1 (NA where a parameter is not in that model).

The file uses NA where a parameter is not in that model, so read it the same way as the other records — CSV.read(..., DataFrame; missingstring="NA"). Without that the parameter columns come back as text, and a trend will silently evaluate as zero rather than erroring.

Students in BEE 4850 compute WAIC from this sample.

Students in BEE 5850 must instead sample the posterior themselves, state and justify their priors, and report convergence diagnostics. Compare your results against the provided sample and account for any differences — including differences that come from the priors rather than from the data.

References

List any external references consulted, including classmates, LLMs, and any sources beyond the course materials.