QUALYPSOSS: QUALYPSOSS

View source: R/QUALYPSOSS.r

QUALYPSOSSR Documentation

QUALYPSOSS

Description

QUALYPSOSS

Usage

QUALYPSOSS(
  ClimateProjections,
  scenAvail,
  vecYears = NULL,
  predCont = NULL,
  predContUnique = NULL,
  iCpredCont = NULL,
  iCpredContUnique = NULL,
  listOption = NULL,
  RK = NULL
)

Arguments

ClimateProjections

matrix nT x nS of climate projections where nT is the number of values for the continuous predictor (years, global temperature) and nS the number of scenarios.

scenAvail

matrix of scenario characteristics nS x nK where nK is the number of discrete predictors.

vecYears

(optional) vector of years of length nT (by default, a vector 1:nT).

predCont

(optional) matrix nT x nS of continuous predictors.

predContUnique

(optional) vector of length nP corresponding to the continuous predictor for which we want to obtain the prediction.

iCpredCont

(optional) index in 1:nT indicating the reference period (reference period) for the computation of change variables.

iCpredContUnique

(optional) index in 1:nP indicating the reference continuous predictor for the computation of change variables.

listOption

(optional) list of options

  • spar: if uniqueFit is true, smoothing parameter passed to the function smooth.spline.

  • lambdaClimateResponse: smoothing parameter > 0 for the extraction of the climate response.

  • lambdaHyperParANOVA: hyperparameter b for the λ parameter related to each predictor g.

  • typeChangeVariable: type of change variable: "abs" (absolute, value by default) or "rel" (relative).

  • nBurn: number of burn-in samples (default: 1000). If nBurn is too small, the convergence of MCMC chains might not be obtained.

  • nKeep: number of kept samples (default: 2000). If nKeep is too small, MCMC samples might not be represent correctly the posterior distributions of inferred parameters.

  • quantileCompress: vector of probabilities (in [0,1]) for which we compute the quantiles from the posterior distributions quantileCompress = c(0.005,0.025,0.05,0.5,0.95,0.975,0.995) by default.

  • uniqueFit: logical, if FALSE (default), climate responses are fitted using Bayesian smoothing splines, otherwise,if TRUE, a unique cubic smoothing spline is fitted for each run, using the function smooth.spline.

  • returnMCMC: logical, if TRUE, the list MCMC contains MCMC chains.

  • returnOnlyCR: logical, if TRUE (default), only Climate Responses are fitted and returned.

  • type.temporal.dep: "iid" for independent errors or "AR1" (default) for autocorrelated errors.

  • type.hetero: "constant" for homoscedastic errors or "linear" (default) for heteroscedastic errors.

RK

Reproducing kernels: list

Value

list with the following fields:

  • POINT: list containing the mean estimate of different quantities: RESIDUALVAR (residual variability), INTERNALVAR (internal variability), GRANDMEAN (grand mean for all time steps), MAINEFFECT (list with one item per discrete predictor i, containing matrices nT x nEffi, where nEffi is the number of possible values for the discrete predictor i). EFFECTVAR, uncertainty related to the different main effect, TOTVAR Total variability, DECOMPVAR, decomposition of the total variability (percentages) for the different components, CONTRIB_EACH_EFFECT, contribution of each individual effects (percentages) to the corr. effect uncertainty.

  • BAYES: list containing quantiles of different estimated quantities, listed in POINT.

  • MCMC: list containing the MCMC chains (not returned by default).

  • climateResponse: list containing different objects related to the extraction of the climate response. phiStar (φ^*) is an array nQ x nS x nP containing climate change responses, where nQ is the number of returned quantiles, nS is the number of scenarios and nP is the length of predContUnique (e.g. number of future years). Similarly, etaStar (η^*) contains the deviation from the climate change response. phi (φ) contains the climate responses and eta (η) contains the deviations from the climate responses.

  • listCR: list containing objects created during the extraction of the climate responses

  • ClimateProjections: argument of the call to the function, for records.

  • predCont: (optional) argument of the call to the function, for records.

  • predContUnique: (optional) argument of the call to the function, for records.

  • predDiscreteUnique: list of possible values taken by the discrete predictors given in scenAvail.

  • listOption: list of options

  • listScenario: list of scenario characteristics (obtained from QUALYPSOSS.process.scenario)

  • RK: list containing the reproducing kernels

Author(s)

Guillaume Evin

Examples

##########################################################################
# SYNTHETIC SCENARIOS
##########################################################################
# create nS=3 fictive climate scenarios with 2 GCMs and 2 RCMs, for a period of nY=20 years
n=20
t=1:n/n

# GCM effects (sums to 0 for each t)
effGCM1 = t*2
effGCM2 = t*-2

# RCM effects (sums to 0 for each t)
effRCM1 = t*1
effRCM2 = t*-1

# These climate scenarios are a sum of effects and a random gaussian noise
scenGCM1RCM1 = effGCM1 + effRCM1 + rnorm(n=n,sd=0.5)
scenGCM1RCM2 = effGCM1 + effRCM2 + rnorm(n=n,sd=0.5)
scenGCM2RCM1 = effGCM2 + effRCM1 + rnorm(n=n,sd=0.5)
ClimateProjections = cbind(scenGCM1RCM1,scenGCM1RCM2,scenGCM2RCM1)

# Here, scenAvail indicates that the first scenario is obtained with the combination of the
# GCM "GCM1" and RCM "RCM1", the second scenario is obtained with the combination of
# the GCM "GCM1" and RCM "RCM2" and the third scenario is obtained with the combination
# of the GCM "GCM2" and RCM "RCM1".
scenAvail = data.frame(GCM=c('GCM1','GCM1','GCM2'),RCM=c('RCM1','RCM2','RCM1'))

listOption = list(nBurn=20,nKeep=30,type.temporal.dep="iid",type.hetero="constant")
QUALYPSOSSOUT = QUALYPSOSS(ClimateProjections=ClimateProjections,scenAvail=scenAvail,
listOption=listOption)

# QUALYPSOSSOUT output contains many different information about climate projections uncertainties,
# which can be plotted using the following functions.

# plotQUALYPSOSSClimateResponse draws the climate responses, for all simulation chains, 
# in comparison to the raw climate responses.
plotQUALYPSOSSClimateResponse(QUALYPSOSSOUT)

# plotQUALYPSOSSClimateChangeResponse draws the climate change responses, for all simulation chains.
plotQUALYPSOSSClimateChangeResponse(QUALYPSOSSOUT)

# plotQUALYPSOSSeffect draws the estimated effects, for a discrete predictor specified by iEff,
# as a function of the continuous predictor.
plotQUALYPSOSSeffect(QUALYPSOSSOUT, iEff = 1)
plotQUALYPSOSSeffect(QUALYPSOSSOUT, iEff = 2)

# plotQUALYPSOSSgrandmean draws the estimated grand mean, as a function of the continuous predictor.
plotQUALYPSOSSgrandmean(QUALYPSOSSOUT)

# plotQUALYPSOSSTotalVarianceDecomposition draws the decomposition of the total variance responses,
# as a function of the continuous predictor.
plotQUALYPSOSSTotalVarianceDecomposition(QUALYPSOSSOUT)


qualypsoss documentation built on Aug. 31, 2022, 5:09 p.m.