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

Consist_Trend

Computes Trends Using Only Model Data For Which Observations Are Available


Description

Computes the trend coefficients for a time series by least square fitting, together with the associated error interval for both the observational and model data.
Provides also the detrended observational and modeled data.
By default, the trend is computed along the second dimension of the input array, which is expected to be the start date dimension. For arrays containing multiple model members, the user will first have to calculate the ensemble average using Mean1Dim() or elsewhise (see the example).

Usage

Consist_Trend(var_exp, var_obs, interval = 1)

Arguments

var_exp

Ensemble mean of model hindcasts with dimensions:
c(nmod/nexp, nsdates, nltime) up to
c(nmod/nexp, nsdates, nltime, nlevel, nlat, nlon)

var_obs

Ensemble mean of observational data with dimensions:
c(nobs, nsdates, nltime) up to
c(nobs, nsdates, nltime, nlevel, nlat, nlon)
Dimensions 2 to 6 should be the same as var_exp.

interval

Number of months/years between 2 start dates. Default = 1. The trends will be provided respectively in field unit per month or per year.

Value

$trend

Trend coefficients of model and observational data with dimensions:
c(nmod/nexp + nobs, 3, nltime) up to
c(nmod/nexp + nobs, 3, nltime, nlevel, nlat, nlon)
The length 3 dimension corresponds to the lower limit of the 95% confidence interval, the slope of the trends and the upper limit of the 95% confidence interval.

$detrendedmod

Same dimensions as var_exp with linearly detrended values of var_exp along the second = start date dimension.

$detrendedobs

Same dimensions as var_exp with linearly detrended values of var_obs along the second = start date dimension.

Author(s)

History:
0.1 - 2011-11 (V. Guemas, vguemas@ic3.cat) - Original code
1.0 - 2013-09 (N. Manubens, nicolau.manubens@ic3.cat) - Formatting to R CRAN

Examples

#'# Load sample data as in Load() example:
example(Load)
clim <- Clim(sampleData$mod, sampleData$obs)
ano_exp <- Ano(sampleData$mod, clim$clim_exp)
ano_obs <- Ano(sampleData$obs, clim$clim_obs)
runmean_months <- 12
dim_to_smooth <- 4  # Smooth along lead-times
smooth_ano_exp <- Smoothing(ano_exp, runmean_months, dim_to_smooth)
smooth_ano_obs <- Smoothing(ano_obs, runmean_months, dim_to_smooth)
dim_to_mean <- 2  # Mean along members
years_between_startdates <- 5
trend <- Consist_Trend(Mean1Dim(smooth_ano_exp, dim_to_mean), 
                      Mean1Dim(smooth_ano_obs, dim_to_mean), 
                      years_between_startdates)

 
PlotVsLTime(trend$trend, toptitle = "trend", ytitle = "K/(5 years)", 
           monini = 11, limits = c(-0.8, 0.8), listexp = c('CMIP5 IC3'), 
           listobs = c('ERSST'), biglab = FALSE, hlines = c(0), 
           fileout = 'tos_consist_trend.eps')
PlotAno(InsertDim(trend$detrendedmod,2,1), InsertDim(trend$detrendedobs,2,1), 
       startDates, "Detrended tos anomalies", ytitle = 'K', 
       legends = 'ERSST', biglab = FALSE, fileout = 'tos_detrended_ano.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.