RAnEnExtra::schaakeShuffle is a method to improve autocorrelation within ensemble members in the spatial and temporal constructions by reordering the memebers.

schaakeShuffle(anen, obs.search, show.progress = F, allow.na = F, seed = 42)

Arguments

anen

Analogs from generateAnalogs.default. The dimensions should be (stations, test times, FLTs, members).

obs.search

The aligned observations with 4 dimensions (parameters, stations, search times, FLTs). However, please make sure there is only 1 parameter. Observations can be created from alignObservations.

allow.na

Whether to allow NA values to exist in selected days. Since the the N search days are randomly chosen and there might be NA in the values. Typically, this function will try to find a station index and a lead time index that does not have NA values. But if it fails to do so, you have to consider what you need to do next: 1) You can check why you have so many NA values in the observations, or 2) you can simply allow sorting with NA, and then all the NA values be placed to the end.

seed

A random seed for reproducibility.

Details

Although the absolute verification statistics of a particular ensemble (e.g. RMSE, bias, and etc.) are not affected by reordering the members, the reordered ensemble members preserve a better autocorrelation structure when inspected one by one, for example, plotting the first member of all ensembles.

The algorithm is as follows:

-- For each test day
      Randomly choose N search days (N is the number of ensemble members)
      Establish the linking function B
      -- For each FLT
         -- For each station
            Reorder enmseble members using the linking function B
         -- End of stations
      -- End of FLTs
-- End of test days

References

Sperati, Simone, Stefano Alessandrini, and Luca Delle Monache. "Gridded probabilistic weather forecasts with an analog ensemble." Quarterly Journal of the Royal Meteorological Society 143.708 (2017): 2874-2885.