Simulated Nulls · Trend

Is the Surge Rising?

Simulate records with no trend to test the slope of San Francisco's annual maximum water levels (high tide plus storm surge), then compare the result with the \(t\)-test.

Simulate Records With No Trend

The tide gauge at San Francisco has recorded the water level every hour since 1897. Subtract from each hourly level the average of the fifteen days around it, which removes sea-level rise and the seasons and leaves high tide plus storm surge. The highest of these in each year from 1898 to 2022 gives 125 annual maxima, and their least-squares slope is 0.41 mm per year. Could a slope this large turn up in a null world with no trend? Draw records from the null world, fit each one's slope, and see how often the slopes are at least this large.

First, a guess: in a null world with no trend, how often would a 125-year record show a slope of at least 0.41 mm per year?

Data
Null world
Alternative

Slopes of every simulated record

This Test's Choices

  • Test statistic: the least-squares slope of the record, 0.41 mm per year.
  • Null model: no trend, and one of
    • Gaussian years: each year an independent Gaussian draw with the record's mean (1.29 m) and standard deviation (7.4 cm);
    • shuffled years: the record's own 125 values in a random order; or
    • resampled years: 125 values drawn with replacement from the record's own values.
  • Alternative hypothesis: a rise, so only large positive slopes count against the null; or any trend, so slopes far from zero in either direction count (see below).

The three null worlds give nearly the same p, about 0.014 for a rise. Each keeps the record's spread and treats the years as exchangeable, meaning any year could trade places with any other. They differ mainly in the shape of the distribution each year's maximum comes from, which has little effect because the slope is a weighted sum of 125 values.

With \(x_i\) the year and \(y_i\) its maximum, \(i = 1, \ldots, n\): \[\hat\beta_1 = \frac{\sum_i (x_i - \bar x)(y_i - \bar y)}{\sum_i (x_i - \bar x)^2}, \qquad p \approx \frac{\#\{j : \hat\beta^{*}_{1,j} \geq \hat\beta_1\}}{N},\] where \(\hat\beta^{*}_{1,j}\) is the slope of simulated record \(j\) from the null world and \(N\) the number of simulated records. For "Any trend", count \(|\hat\beta^{*}_{1,j}| \geq |\hat\beta_1|\) instead. The Monte Carlo standard error of the estimate is \(\sqrt{p(1-p)/N}\).

Which simulated slopes count as "at least as large" depends on the question, which the alternative hypothesis states. If the question is whether the maxima are rising, only slopes of 0.41 mm per year or more count: the right-hand tail of the histogram ("A rise" in the figure). If the question is whether there is any trend, up or down, slopes at least 0.41 from zero in either direction count: both tails ("Any trend"), and p roughly doubles. Choose the question before looking at the data. Choosing one tail after seeing which way the slope went halves p without any new evidence.

A p-value is computed from data, so, like the slope, it changes from record to record: another 125 years of storms would give another p. The size of the trend is read from the slope, 0.41 mm per year, not from p.

The \(t\)-Test

The \(t\)-test gets the null distribution from a formula instead of simulation. It divides the slope by its standard error and compares the result, the \(t\)-statistic, with a \(t\) distribution. That distribution is exact when the years' deviations from the mean are independent and Gaussian with a constant standard deviation. Simulating the \(t\)-statistic in Gaussian years would reproduce the \(t\)-test's p-value up to Monte Carlo error; simulating the slope, as the figure does, gives nearly the same p. With 125 years the \(t\)-test's one-sided p is 0.014.

With fitted intercept \(\hat\beta_0\), \[\text{se}(\hat\beta_1) = \sqrt{\frac{\sum_i (y_i - \hat\beta_0 - \hat\beta_1 x_i)^2 / (n - 2)}{\sum_i (x_i - \bar x)^2}}, \qquad t = \frac{\hat\beta_1}{\text{se}(\hat\beta_1)},\] and \(t\) has a \(t_{n-2}\) distribution in the Gaussian null world.

Bootstrap and Permutation Tests

"Resampled years" is a nonparametric bootstrap test: it draws from the record's own values, with replacement, and assigns them to years at random, so the null holds. "Gaussian years" is a parametric bootstrap test: it fits a model with the null imposed (a Gaussian with no trend) and simulates from the fit. "Shuffled years" is a permutation test.

The shuffle assumes the years are exchangeable; the Gaussian and resampled null worlds, like the \(t\)-test, go further and treat them as independent draws. If high years tend to follow high years (persistence), neither assumption holds: a record drifts more than independent years do, and these tests give p below 0.05 more than 5% of the time when there is no trend. San Francisco's maxima show little persistence: the correlation between one year's maximum and the next year's is 0.07.