Trend: Computes the Trend of the Ensemble Mean

View source: R/Trend.R

TrendR Documentation

Computes the Trend of the Ensemble Mean

Description

Computes the trend along the forecast time of the ensemble mean by least square fitting, and the associated error interval.
Trend() also provides the time series of the detrended ensemble mean forecasts.
The confidence interval relies on a student-T distribution.

.Trend provides the same functionality but taking a matrix ensemble members as input (exp).

Usage

Trend(var, posTR = 2, interval = 1, siglev = 0.95, conf = TRUE)

.Trend(exp, interval = 1, siglev = 0.95, conf = TRUE)

Arguments

var

An array of any number of dimensions up to 10.

posTR

An integer indicating the position along which to compute the trend.

interval

A number of months/years between 2 points along posTR dimension. Set 1 as default.

siglev

A numeric value indicating the confidence level for the computation of confidence interval. Set 0.95 as default.

conf

A logical value indicating whether to compute the confidence levels or not. Set TRUE as default.

exp

An M by N matrix representing M forecasts from N ensemble members.

Value

$trend

The intercept and slope coefficients for the least squares fitting of the trend. An array with same dimensions as parameter 'var' except along the posTR dimension, which is replaced by a length 4 (or length 2 if conf = FALSE) dimension, corresponding to the lower limit of the confidence interval (only present if conf = TRUE), the slope, the upper limit of the confidence interval (only present if conf = TRUE), and the intercept.

$detrended

Same dimensions as var with linearly detrended var along the posTR dimension.

Only in .Trend:

$conf.int

Corresponding to the limits of the siglev% confidence interval (only present if conf = TRUE) for the slope coefficient.

Author(s)

History:
0.1 - 2011-05 (V. Guemas) - Original code
1.0 - 2013-09 (N. Manubens) - Formatting to CRAN
2.0 - 2017-02 (A. Hunter) - Adapt to veriApply()

Examples

# Load sample data as in Load() example:
example(Load)
months_between_startdates <- 60
trend <- Trend(sampleData$obs, 3, months_between_startdates)
 
PlotVsLTime(trend$trend, toptitle = "trend", ytitle = "K / (5 year)",
           monini = 11, limits = c(-1,1), listexp = c('CMIP5 IC3'),
           listobs = c('ERSST'), biglab = FALSE, hlines = 0,
           fileout = 'tos_obs_trend.eps')
PlotAno(trend$detrended, NULL, startDates, 
       toptitle = 'detrended anomalies (along the startdates)', ytitle = 'K',
       legends = 'ERSST', biglab = FALSE, fileout = 'tos_detrended_obs.eps')
 


s2dverification documentation built on April 20, 2022, 9:06 a.m.