get_quantiles: Quantile sampling

View source: R/get_quantiles.R

get_quantilesR Documentation

Quantile sampling

Description

Creates a matrix of sampled quantiles for drawing new ensemble members

Usage

get_quantiles(n_members, method, n_reps = 1)

Arguments

n_members

number of members in the ensemble. This must be an integer.

method

character string corresponding to the desired quantile sampling method and must be one of 'R', 'Q', 'QJ' or 'QH'.

n_reps

number of replicates of the function corresponding to the dimension of the forecast

Details

If the method is 'R' then the quantiles are randomly sampled. If the method is 'Q' then the sampled quantiles are equally spaced. If the method is 'QH' then the sampled quantiles are equally spaced using a different sampling scheme. If the method is 'QJ' then the sampled quantiles are equally spaced and jittered.

Value

a matrix of sample quantiles where the number of rows corresponds to n_reps and the number of columns corresponds to n_members

Author(s)

Kate Saunders and Kirien Whan

See Also

run_shuffle_template

Examples


# Examples of the different sampling methods
get_quantiles(n_members = 3, method = "R")
get_quantiles(n_members = 4, method = "Q")
get_quantiles(n_members = 4, method = "QJ")
get_quantiles(n_members = 5, method = "QH")

# Examples showing difference in methods for repeat sampling
get_quantiles(n_members = 3, method = "R", n_reps = 2)
get_quantiles(n_members = 3, method = "Q", n_reps = 2)


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