Learn R Programming

s2dv (version 2.1.0)

SignalNoiseRatio: Calculate Signal-to-noise ratio

Description

This function computes the signal-to-noise ratio, where the signal is the ensemble mean variance and the noise is the variance of the ensemble members about the ensemble mean (Eade et al., 2014; Scaife and Smith, 2018).

Usage

SignalNoiseRatio(
  data,
  time_dim = "year",
  member_dim = "member",
  na.rm = FALSE,
  ncores = NULL
)

Value

An array with of the signal-to-noise ratio. It has the same dimensions as 'data' except 'time_dim' and 'member_dim' dimensions.

Arguments

data

A numerical array with, at least, 'time_dim' and 'member_dim' dimensions.

time_dim

A character string indicating the name of the time dimension in 'data'. The default value is 'year'.

member_dim

A character string indicating the name of the member dimension in 'data'. The default value is 'member'.

na.rm

A logical value indicating whether to remove NA values during the computation. The default value is FALSE.

ncores

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

Examples

Run this code
exp <- array(data = runif(600), dim = c(year = 15, member = 10, lat = 2, lon = 2))
SignalNoiseRatio(exp)

Run the code above in your browser using DataLab