background story 3 · dependence correction

3DBC: rank correction and shuffling

3DBC takes three daily series for one location: observations for , model output for the same period, and model output for . The first two determine a target ordering for the third. The future values are then permuted within each calendar-day group; their numerical values are unchanged.

The worked example is , model chain , . Every figure on the page comes from the production data for this example.

scroll

Inputs and output

The three inputs are the observed reference for , the same years from a climate model chain, and that chain’s future window, . The output is a reordering of the third series. Within each calendar-day group, the output contains exactly the same values as the model-future input.

3DBC is three-dimensional bias correction, from Mehrotra & Sharma (2019), where the three dimensions are variables, time and space. In the paper the method has two halves: quantile mapping for the marginals, then rank correction and shuffling for the dependence. Framklim runs the second half on MET’s EQM daily series, which is the quantile-mapping stage, grouped by calendar day over a thirty-year window as the paper describes.

Group by calendar day

The implementation processes each calendar date separately. All thirty values form one group, the thirty values of the next date form another, and so on across groups. Values from different dates are never compared.

29 February is excluded. The reference window contains of them and the future window , so the group would not be square. Those future rows pass through uncorrected and the next stage drops them.

Values in one calendar-day group

For the group holds observed values, one per year, and the same count for the model-historical and model-future series. Year k of each window occupies row k, which is how the method pairs them. The remaining steps operate inside this table and repeat times.

Values by year

Each dot represents one year, with height encoding the value. The outlined future value remains marked as it is assigned to a new year in the later frames.

Convert values to ranks

Each vector is replaced by its ranks, 1 to , with tied values sharing an averaged rank. Units are discarded; only the ordering within the group is carried forward.

Transform ranks to normal scores

Rank r becomes a probability p = r / (n + 1), and p becomes a normal score through the inverse normal CDF. This is the plotting position the paper uses: its Table 1 assigns the maximum of thirty values p = 30/31, as here.

Tied values share an averaged rank, so the three score sets can differ slightly. The ordering, not the score values, is what the method uses.

Normal scores in year order

Each series contains the normal scores for thirty consecutive occurrences of , ordered by year.

Lag-1 autocorrelation

Each score is plotted against the next year’s score. The fitted slope is the lag-1 autocorrelation: ρobs = , ρcur = , ρfut = .

The lag is between years within one date — 1991 to 1992 — and not between adjacent days. The paper flags this too: the AR term is computed for the same calendar day across years, and is not an AR model of the daily series.

Adjust the observed autocorrelation

The correction transfers the model’s change in persistence rather than its level. Written additively that would be ρnew = ρfut − ρcur + ρobs, which can leave the valid range near ±1 because correlations are not additive. The subtraction is therefore performed in Fisher’s z space and transformed back, giving equation (1) of the paper:

a = (1 + ρfut) / (1 + ρcur) · (1 + ρobs)
b = (1 − ρfut) / (1 − ρcur) · (1 − ρobs)
ρnew = (a − b) / (a + b)

The chain moves from to , so the observed becomes . The result is clipped to ±0.9999. The construction is from Bárdossy & Pegram (2012).

Build the target score sequence

The implementation applies the inverse AR(1) recurrence parameterized by ρobs to the observed score sequence, then applies the forward recurrence with ρnew. The resulting sequence, zfc, supplies the target ranks for the shuffle.

Permute the future values

The thirty future values and the thirty target scores are each sorted, then paired in order: the smallest value goes to the slot with the smallest target score. The operation changes the assignment of values to years, without changing the values in the group.

Each value moves horizontally to a different year; its height, which is its value, does not change. In this group of slots hold a different year’s value afterwards.

Permutation verification

Both rows hold the same thirty values across the same run of years. Sorting either row gives the same result. The same holds for every calendar-day group, not only this one.

  • mean →
  • min
  • max
  • sorted values identical

Thirty-year output

groups × variables completes the thirty-year series. The hourly construction uses it next. Each future day now has a daily target whose rank is consistent with the reference hourly pattern it will be shaped onto.

Each calendar date’s thirty-year distribution is preserved. The overall thirty-year mean is therefore identical to the last decimal — either way, and the same for each seasonal climatology. Individual years are not preserved: consecutive dates are permuted independently, so the values making up any single output year are drawn from across the whole model window.

Year 2057 in the output is not the chain’s year 2057, and the product should not be used for year-by-year comparison against a model run. The shuffle restores the observed ordering within each calendar day. It does not project a change in the dependence structure itself.