Learn R Programming

sensobol: an R package to compute variance-based sensitivity indices

The R package sensobol provides several functions to conduct variance-based uncertainty and sensitivity analysis, from the estimation of sensitivity indices to the visual representation of the results. It implements several state-of-the-art first and total-order estimators and allows the computation of up to fourth-order effects, as well as of the approximation error, in a swift and user-friendly way.

Installation

To install the stable version on CRAN, use

install.packages("sensobol")

To install the development version, use devtools:

install.packages("devtools") # if you have not installed devtools package already
devtools::install_github("arnaldpuy/sensobol", build_vignettes = TRUE)

Example

This brief example shows how to compute Sobol' indices. For a more detailed explanation of the package functions, check the vignette.

## Load the package:
library(sensobol)

## Define the base sample size and the parameters
N <- 2 ^ 8
params <- paste("X", 1:3, sep = "")

## Create sample matrix to compute first and total-order indices:
mat <- sobol_matrices(N = N, params = params)

## Compute the model output (using the Ishigami test function):
Y <- ishigami_Fun(mat)

## Compute and bootstrap the Sobol' indices:
ind <- sobol_indices(Y = Y, N = N, params = params)

Citation

Please use the following citation if you use sensobol in your publications:

A. Puy, S. Lo Piano, A. Saltelli, S. A. Levin (2022). sensobol: Computation of 
Variance-Based Sensitivity Indices. Journal of Statistical Software 102(5), 
1-37. doi:10.18637/jss.v102.i05.

A BibTex entry for LaTex users is:

@article{,
author = {Puy, Arnald and {Lo Piano}, Samuele and Saltelli, Andrea and Levin, Simon A.},
journal = {Journal of Statistical Software},
title = {{sensobol: an R package to compute variance-based sensitivity indices}},
doi = {10.18637/jss.v102.i05},
volume = {102}, 
number = {5},
pages = {1--37},
year = {2022}
}

Copy Link

Version

Install

install.packages('sensobol')

Monthly Downloads

364

Version

1.1.5

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Arnald Puy

Last Published

February 21st, 2024

Functions in sensobol (1.1.5)

print.sensobol

Display the results obtained with the sobol_indices function.
sobol_dummy

Computation of Sobol' indices for a dummy parameter
vars_to

Computation of VARS Total order index (VARS-TO)
vars_matrices

STAR-VARS sampling strategy
bratley1992_Fun

Bratley, Fox and Niederreiter (1992) function.
oakley_Fun

Oakley & O'Hagan (2004) function
plot_multiscatter

Pairwise combinations of model inputs with the colour proportional the model output value.
load_packages

Load (and install) R packages.
metafunction

Random metafunction based on Becker2020;textualsensobol's metafunction.
ishigami_Fun

Ishigami function
discrepancy_ersatz

Computation of the S-ersatz discrepancy.
plot_scatter

Scatter plots of the model output against the model inputs.
bratley1988_Fun

Bratley and Fox (1988) function
plot.sensobol

Visualization of first, total, second, third and fourth-order Sobol' indices.
sensobol-package

sensobol: Computation of Variance-Based Sensitivity Indices
sobol_convergence

Check convergence of Sobol' indices.
plot_uncertainty

Visualization of the model output uncertainty
print.vars

Display the results obtained with the vars_to function.
sobol_ode

Wrapper around deSolve ode.
sobol_matrices

Creation of the sample matrices
sobol_Fun

Sobol' G function
sobol_indices

Computation of Sobol' indices