Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

Trend

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, virginie.guemas@ic3.cat) - Original code
1.0 - 2013-09 (N. Manubens, nicolau.manubens@ic3.cat) - Formatting to CRAN
2.0 - 2017-02 (A. Hunter, alasdair.hunter@bsc.es) - 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

Set of Common Tools for Forecast Verification

v2.10.0
Apache License 2.0
Authors
BSC-CNS [aut, cph], Virginie Guemas [aut], Nicolau Manubens [aut], An-Chi Ho [ctb, cre], Nuria Perez-Zanon [ctb], Javier Garcia-Serrano [aut], Neven Fuckar [aut], Louis-Philippe Caron [aut], Omar Bellprat [aut], Luis Rodrigues [aut], Veronica Torralba [aut], Alasdair Hunter [aut], Chloe Prodhomme [aut], Martin Menegoz [aut], Domingo Manubens [ctb], Constantin Ardilouze [ctb], Lauriane Batte [ctb], Fabian Lienert [ctb], Julia Giner [ctb], Jean-Philippe Baudouin [ctb], Nube Gonzalez [ctb], Ludovic Auger [ctb], Nicola Cortesi [ctb], Eleftheria Exarchou [ctb], Ruben Cruz [ctb], Isabel Andreu-Burillo [ctb], Ramiro Saurral [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.