Learn R Programming

s2dv (version 0.0.1)

RMSSS: Compute root mean square error skill score

Description

Compute the root mean square error skill score (RMSSS) between an array of forecast 'exp' and an array of observation 'obs'. The two arrays should have the same dimensions except along memb_dim, where the length can be different, with the number of experiments/models (nexp) and the number of observational datasets (nobs). RMSSS computes the root mean square error skill score of each jexp in 1:nexp against each jobs in 1:nobs which gives nexp * nobs RMSSS for each other grid point of the array. The RMSSS are computed along the time_dim dimension which should corresponds to the startdate dimension. The p-value is optionally provided by an one-sided Fisher test.

Usage

RMSSS(exp, obs, time_dim = "sdate", memb_dim = "member", pval = TRUE,
  ncores = NULL)

Arguments

exp

A named numeric array of experimental data which contains at least two dimensions for memb_dim and time_dim.

obs

A named numeric array of observational data which contains at least two dimensions for memb_dim and time_dim. The dimensions should be the same as paramter 'exp' except the length of 'memb_dim' dimension. The order of dimension can be different.

time_dim

A character string indicating the name of dimension along which the RMSSS are computed. The default value is 'sdate'.

memb_dim

A character string indicating the name of member (nobs/nexp) dimension. The default value is 'member'.

pval

A logical value indicating whether to compute or not the p-value of the test Ho: RMSSS = 0. If pval = TRUE, the insignificant RMSSS will return NA. The default value is TRUE.

ncores

An integer indicating the number of cores to use for parallel computation. The default value is NULL.

Value

A list containing the numeric arrays with dimension: c(nexp, nobs, all other dimensions of exp except time_dim). nexp is the number of experiment (i.e., memb_dim in exp), and nobs is the number of observation (i.e., memb_dim in obs).

$rmsss

The root mean square error skill score.

$p.val

The p-value. Only present if pval = TRUE.

Examples

Run this code
# NOT RUN {
set.seed(1)
exp <- array(rnorm(15), dim = c(dat = 1, time = 3, member = 5))
set.seed(2)
obs <- array(rnorm(6), dim = c(time = 3, member = 2, dat = 1))
res <- RMSSS(exp, obs, time_dim = 'time')

# }

Run the code above in your browser using DataLab