get_sim_schaake_template: Shuffles a post-processed forecast to restore dependence...

View source: R/get_sim_schakke_template.R

get_sim_schaake_templateR Documentation

Shuffles a post-processed forecast to restore dependence using observations from past dates that had similar forecasts

Description

Shuffles a post-processed forecast to restore dependence using observations from past dates that had similar forecasts

Usage

get_sim_schaake_template(forecast, forecast_list, obs_list)

Arguments

forecast

is a matrix where the columns correspond to members with the unrealistic dependence structure, and the rows are a space or time dimension

template

is a matrix where the columns correspond to the template for dependence structure, and the rows are a space or time dimension

Details

For a forecast that has been sampled from a post-processed forecast distribution the members need to be reshuffled to restore a meaningful dependence structure in space, time or both.

This function uses a template to reshuffle the sample ensemble members. The template can be one of climatology, as in the Schaake shuffle, or can be from the raw ensemble forecast, as in empirical copula coupling.

Value

a matrix where the post-processed forecast with dependence based on the template

Author(s)

Kate Saunders and Kirien Whan

References

Sim Schaake paper

Examples


num_stations = 2
num_lead_times = 4
forecast_dim = num_stations*num_lead_times
num_members = 3
forecast = rnorm(forecast_dim*num_members) |>
               matrix(forecast_dim, num_members)

forecast_list = list(forecast - 1, forecast + 0.5, forecast + 1, forecast + 2)
obs_list = list(rnorm(forecast_dim) - 1, rnorm(forecast_dim) + 0.5,
                     rnorm(forecast_dim) + 1, rnorm(forecast_dim) + 2)

template = get_sim_schaake_template(forecast, forecast_list, obs_list)


katerobsau/depPPR documentation built on July 2, 2023, 10:48 p.m.