Type: Package
Title: Global Sensitivity Analysis Tool
Version: 1.0.0
Maintainer: Camila Garcia-Echeverri <cagarciae@unal.edu.co>
Description: A tool to sensitivity analysis using SOBOL (Sobol, 1993) and AMA (Dell'Oca et al. 2017 <doi:10.5194/hess-21-6219-2017>) indices. It allows to identify the most sensitive parameter or parameters of a model.
Depends: R (≥ 3.4)
Imports: stats, e1071, utils
Suggests: knitr, rmarkdown
License: GPL-2
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.0
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2020-07-09 20:41:30 UTC; camil
Author: Camila Garcia-Echeverri ORCID iD [aut, cre], Maria Arenas-Bautista ORCID iD [cot], Leonardo Donado ORCID iD [cot]
Repository: CRAN
Date/Publication: 2020-07-10 09:40:03 UTC

AMA indices

Description

This function calculates the AMA indices: AMAE, AMAV, AMAV and AMAK.

Usage

AMA(data_Bstat, CM, pp_names, steps = 100)

Arguments

data_Bstat

a data frame of dimensions t x 6, here t is the number of temporary steps and each column corresponds to a statistical measure: mean, variance, skewness, kurtosis and excess kurtosis.

CM

A list of arrays, each array corresponds to the conditional moments calculated with the mean, variance, skewness, kurtosis. Each array has dimensions of steps, t, p.

pp_names

vector that contains the names of the parameters (pp)

steps

number of divisions of the parametric range

Value

A list of four matrices, which corresponds to AMAE, AMAV, AMAR and AMAK indices. Each matrix has dimensions of t x pp.

Author(s)

Camila Garcia-Echeverri <cagarciae@unal.edu.co>
Maria Cristina Areas-Bautista <mcarenasb@unal.edu.co>

Hydrodynamics of the natural media research group - HYDS National University of Colombia - Bogota

References

Dell’Oca, A., Riva, M., & Guadagnini, A. (2017). Moment-based metrics for global sensitivity analysis of hydrological systems. Hydrology and Earth System Sciences, 21(12), 6219–6234. https://doi.org/10.5194/hess-21-6219-2017

Examples

data("data_Bstat", "CM", "pp_names")
AMA_indices <- AMA(data_Bstat, CM, pp_names, steps= 15)



Basic statistical measures of a mathematical model results

Description

This function calculates the mean, variance, skewness, kurtosis and excess kurtosis of a model output, this output can be given for different temporal periods (days, months or years).

Usage

Bstat(out_set)

Arguments

out_set

matrix of dimensions n x t, where n equals the number of runs and t is equal to the number of temporary steps.

Value

a data frame of dimensions t x 6, here t is the number of temporary steps and each column corresponds to a statistical measure: mean, variance, skewness, kurtosis and excess kurtosis.

Author(s)

Camila Garcia-Echeverri <cagarciae@unal.edu.co>

Hydrodynamics of the natural media research group - HYDS National University of Colombia - Bogota

Examples

data("out_set")
data_Bstat <- Bstat(out_set)


@title First four conditional moments of example data

Description

@description Data generated by Cond_Moments example

Usage

CM

Format

A list

CM

A list of arrays, each array has dimensions of steps, t, pp

Author(s)

Camila Garcia-Echeverri


Conditional statistical moments of a model output

Description

This function evaluates the first four statistical moments after grouping the model output by different parametric ranges.

Usage

Cond_Moments(parameters_set, out_set, pp_names, steps = 100)

Arguments

parameters_set

matrix of dimensions n x pp, where n is the number of runs and pp is the number of parameters.

out_set

matrix of dimensions n x t, where n is the number of runs and t is the number of temporary steps.

pp_names

vector that contains the names of the parameters.

steps

number of divisions of the parametric range.

Value

A list of arrays, each array has dimensions of steps, t, pp.

Author(s)

Camila Garcia-Echeverri <cagarciae@unal.edu.co>
Maria Cristina Areas-Bautista <mcarenasb@unal.edu.co>

Hydrodynamics of the natural media research group - HYDS National University of Colombia - Bogota

Examples

data("parameters_set", "out_set", "pp_names")

CM <- Cond_Moments(parameters_set, out_set, pp_names, steps=15)


Global Sensitivity Analysis tool

Description

This function performs the global sensitivity analysis starting from the gross results of the model.

Usage

GSAtool(
  parameters_set,
  out_set,
  pp_names,
  steps = 100,
  save = FALSE,
  dir = NULL
)

Arguments

parameters_set

matrix of dimensions n x pp, where n is the number of runs and pp is the number of parameters.

out_set

matrix of dimensions n x t, where n is the number of runs and t is the number of temporary steps.

pp_names

a strings vector with the names of the parameters of the model

steps

number of divisions of the parametric range.

save

T to save the results in .csv files, by default save=F.

dir

a directory to save the results

Value

a list containing two outputs: SOBOL and AMA indices.

Author(s)

Camila Garcia-Echeverri <cagarciae@unal.edu.co>
Maria Cristina Areas-Bautista <mcarenasb@unal.edu.co>

Hydrodynamics of the natural media research group - HYDS National University of Colombia - Bogota

References

Dell’Oca, A., Riva, M., & Guadagnini, A. (2017). Moment-based metrics for global sensitivity analysis of hydrological systems. Hydrology and Earth System Sciences, 21(12), 6219–6234. https://doi.org/10.5194/hess-21-6219-2017

Sobol, I. M. (2001). Global sensitivity indices for nonlinear mathematical models and their Monte Carlo estimates. Mathematics and Computers in Simulation, 55(1–3), 271–280. https://doi.org/10.1016/S0378-4754(00)00270-6

Examples

data("parameters_set", "out_set", "pp_names")


GSA_results <- GSAtool(parameters_set, out_set, pp_names, steps = 15, save=FALSE)


SOBOL indices

Description

This function calculates the first order and total SOBOL indices.

Usage

SOBOL(data_var, CM_mean, CM_var, pp_names)

Arguments

data_var

a vector containing the variance of the model output for each modelling time step.

CM_mean

An array containing the conditional mean of each parameter of the model. This array has dimensions of steps x t x pp, where steps is the number of divisions of the parametric range, t is the number of temporary steps and pp the number of parameters of the model.

CM_var

An array containing the conditional variance of each parameter of the model. This array has dimensions of steps x t x pp, where steps is the number of divisions of the parametric range, t is the number of temporary steps and pp the number of parameters of the model.

pp_names

a strings vector with the names of the parameters of the model.

Value

a list containing two matrices. The first contains the first order sobol, the second sobol_total.

Author(s)

Camila Garcia-Echeverri <cagarciae@unal.edu.co>
Maria Cristina Areas-Bautista <mcarenasb@unal.edu.co>

Hydrodynamics of the natural media research group - HYDS National University of Colombia - Bogota

References

Sobol, I. M. (2001). Global sensitivity indices for nonlinear mathematical models and their Monte Carlo estimates. Mathematics and Computers in Simulation, 55(1–3), 271–280. https://doi.org/10.1016/S0378-4754(00)00270-6

Examples

data("data_Bstat", "CM", "pp_names")
SOBOL_indices <- SOBOL(data_Bstat[,3], CM$CM_mean, CM$CM_var , pp_names)


@title First four conditional moments of example data

Description

@description Data generated with the example of the function Cond_Moments

Usage

data_Bstat

Format

A data.frame

data_Bstat

a data frame of dimensions t x 6

Author(s)

Camila Garcia-Echeverri

Source

Function Bstat


@title Results of a sample model

Description

@description Output generated with an example mathematical model.

Usage

out_set

Format

A matrix

out_set

a matrix of dimensions 500 x 365 (pp x t), runs of the model x temporary steps (365 days)

References

Arenas-Bautista, M. C. (2020). Integration of Hydrological and Economical Aspects for Water Management in Tropical Regions. Case Study: Middle Magdalena Valley, Colombia. National University of Colombia.


@title Set of parameters randomly generated

Description

@description It contains 10 parameters

Usage

parameters_set

Format

A matrix

parameters_set

a matrix of dimensions 500 x 10 (n x pp),runs of the model x number of parameters

References

Arenas-Bautista, M. C. (2020). Integration of Hydrological and Economical Aspects for Water Management in Tropical Regions. Case Study: Middle Magdalena Valley, Colombia. National University of Colombia.


@title Example - parameters names

Description

@description 10 parameters names.

Usage

pp_names

Format

A value

pp_names

a vector of characters

Author(s)

CGE

References

Arenas-Bautista, M. C. (2020). Integration of Hydrological and Economical Aspects for Water Management in Tropical Regions. Case Study: Middle Magdalena Valley, Colombia. National University of Colombia.


Save GSA results

Description

This function helps to save the results in .csv format

Usage

save_results(
  SOBOL = NULL,
  SOBOL_total = NULL,
  amae = NULL,
  amav = NULL,
  amar = NULL,
  amak = NULL,
  dir
)

Arguments

SOBOL

SOBOL index

SOBOL_total

SOBOL_total

amae

AMAE index

amav

AMAV index

amar

AMAR index

amak

AMAK index

dir

a directory to save the results

Author(s)

Camila Garcia-Echeverri <cagarciae@unal.edu.co>

Hydrodynamics of the natural media research group - HYDS National University of Colombia - Bogota