Learn R Programming

WACS (version 1.1.0)

WACScompare: Performs comparisons between two WACS data structures, or between two WACS simulation series

Description

The comparison is based on different types of statistics computed on WACSdata1 and WACSdata2, or WACSsim1 and WACSsim2

Usage

WACScompare(
  what = what,
  wacs1 = wacs1,
  wacspar = wacspar,
  wacs2 = wacs2,
  varname = varname,
  varname2 = NULL,
  base = 0,
  above = T,
  months = 1:12
)

Arguments

what

Type of validation. Possible choices are:

="Sim" Compares a simulation run to data
="Rain" qq-plots of rainfall, per season
="MeanSd" Compares monthly mean and standard deviations
="BiVar" Compares bivariate correlations
="CorTemp" Compares temporal correlations
="SumBase" Compares sums above a threshold
="Persistence" Compares persistence of a variable above (or below) a threshold
wacs1

Either WACS data obtained when calling WACSdata, or WACS simulations obtained when calling WACSsimul.

wacspar

WACS parameters estimated when calling WACSestim on wacs1

wacs2

Either WACS data obtained when calling WACSdata, or WACS simulations obtained when calling WACSsimul. Must be of the same class as wacs1

varname

Variable on which the validation is performed

varname2

Second variable on which validation is performed (only needed if what=BiVar)

base

Threshold used for "SumBase" and "Persistence"

above

Boolean value used for "Persistence": TRUE if data is considered above threshold; FALSE otherwise

months

Months to which the analysis should be restricted (only for "SumBase" and "Persistence")

Value

A list containing all information needed for plots; contains also the type of validation, as a class

Examples

Run this code
# NOT RUN {
  ## Simple example
  data(ClimateSeries)
  ThisData = WACSdata(ClimateSeries,from="1995-01-01", to="2005-12-31")
  ThisPar  = WACSestim(ThisData)
  ThatData = WACSdata(ClimateSeries,from="2002-01-01", to="2012-12-31")
  Comp = WACScompare(what="Sim", wacs1=ThisData, wacspar=ThisPar,
                     wacs2=ThatData, varname="tmin")
  WACSplot(Comp)
  Comp = WACScompare(what="MeanSd",wacs1=ThisData, wacspar=ThisPar,
                     wacs2=ThatData, varname="RG")
  WACSplot(Comp)
  Comp = WACScompare(what="SumBase", wacs1=ThisData, wacspar=ThisPar,
                     wacs2=ThatData, varname="tmoy", base=5, months=2:5)
  WACSplot(Comp)
  Comp = WACScompare(what="Persistence",wacs1=ThisData, wacspar=ThisPar,
                     wacs2=ThatData, varname="tmin", base=0, above=FALSE)
  WACSplot(Comp)
# }
# NOT RUN {
 
# }

Run the code above in your browser using DataLab