BEI_TercilesWeighting: Computing the weighted terciles for SFSs.

View source: R/CST_BEI_Weighting.R

BEI_TercilesWeightingR Documentation

Computing the weighted terciles for SFSs.

Description

This function implements the computation to obtain the terciles for a weighted variable for SFSs using a normalized weights array,

Usage

BEI_TercilesWeighting(
  var_exp,
  aweights,
  time_dim_name = "time",
  memb_dim = "member"
)

Arguments

var_exp

Variable (e.g. precipitation, temperature, NAO index) array from a SFS with at least dimensions (time, member) for a spatially aggregated variable or dimensions (time, member, lat, lon) for a spatial variable, as 'time' the spatial dimension by default.

aweights

Normalized weights array with at least dimensions (time, member), when 'time' is the temporal dimension as default.

time_dim_name

A character string indicating the name of the temporal dimension, by default 'time'.

memb_dim

A character string indicating the name of the member dimension, by default 'member'.

Value

BEI_TercilesWeighting() returns an array with at least one dimension depending if the variable is a spatially aggregated variable (as e.g. NAO index)(tercil) or it is spatial variable (as e.g. precipitation or temperature)(tercil, lat, lon), containing the terciles computing with weighted members. The first tercil is the lower tercile, the second is the upper tercile.

Author(s)

Eroteida Sanchez-Garcia - AEMET, esanchezg@aemet.es

References

Regionally improved seasonal forecast of precipitation through Best estimation of winter NAO, Sanchez-Garcia, E. et al., Adv. Sci. Res., 16, 165174, 2019, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.5194/asr-16-165-2019")}

Examples

# Example 1 
var_exp <- 1 : (2 * 4)
dim(var_exp) <- c(time = 2, member = 4)
aweights<- c(0.2, 0.1, 0.3, 0.4, 0.1, 0.2, 0.4, 0.3)
dim(aweights) <- c(time = 2, member = 4)
res <- BEI_TercilesWeighting(var_exp, aweights)

# Example 2 
var_exp <- rnorm(48, 50, 9)
dim(var_exp) <- c(time = 2, member = 4, lat = 2, lon = 3)
aweights<- c(0.2, 0.1, 0.3, 0.4, 0.1, 0.2, 0.4, 0.3)
dim(aweights) <- c(time = 2, member = 4)
res <- BEI_TercilesWeighting(var_exp, aweights)

CSTools documentation built on Oct. 20, 2023, 5:10 p.m.