Learn R Programming

s2dverification (version 2.4.0)

Consist_Trend: Computes Trends Using Only Model Data For Which Observations Are Available

Description

Computes trends 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. The trend is computed along the second dimension, expected to be the start date dimension (the user is supposed to perform an ensemble averaging operation with Mean1Dim() prior to using Consist_trend()).

Usage

Consist_Trend(var_exp, var_obs, interval = 1)

Arguments

Value

$trendTrends 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.$detrendedmodSame dimensions as var_exp with linearly detrended values of var_exp along the second = start date dimension.$detrendedobsSame dimensions as var_exp with linearly detrended values of var_obs along the second = start date dimension.

Examples

Run this code
# 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')

Run the code above in your browser using DataLab