View source: R/get_sim_schakke_template.R
get_sim_schaake_template | R Documentation |
Shuffles a post-processed forecast to restore dependence using observations from past dates that had similar forecasts
get_sim_schaake_template(forecast, forecast_list, obs_list)
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 |
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.
a matrix where the post-processed forecast with dependence based on the template
Kate Saunders and Kirien Whan
Sim Schaake paper
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.