| Title: | Sobol Indices for Models with Fixed and Stochastic Parameters |
|---|---|
| Description: | Tools to design experiments, compute Sobol sensitivity indices, and summarise stochastic responses inspired by the strategy described by Zhu and Sudret (2021) <doi:10.1016/j.ress.2021.107815>. Includes helpers to optimise toy models implemented in C++, visualise indices with uncertainty quantification, and derive reliability-oriented sensitivity measures based on failure probabilities. It is further detailed in Logosha, Maumy and Bertrand (2022) <doi:10.1063/5.0246026> and (2023) <doi:10.1063/5.0246024> or in Bertrand, Logosha and Maumy (2024) <https://hal.science/hal-05371803>, <https://hal.science/hal-05371795> and <https://hal.science/hal-05371798>. |
| Authors: | Frederic Bertrand [cre, aut]
|
| Maintainer: | Frederic Bertrand <[email protected]> |
| License: | GPL-3 |
| Version: | 0.4.0 |
| Built: | 2026-06-01 06:52:38 UTC |
| Source: | https://github.com/fbertran/sobol4r |
Tools to design experiments, compute Sobol sensitivity indices, and summarise stochastic responses inspired by the strategy described by Zhu and Sudret (2021) doi:10.1016/j.ress.2021.107815. Includes helpers to optimise toy models implemented in C++, visualise indices with uncertainty quantification, and derive reliability-oriented sensitivity measures based on failure probabilities. It is further detailed in Logosha, Maumy and Bertrand (2022) doi:10.1063/5.0246026 and (2023) doi:10.1063/5.0246024 or in Bertrand, Logosha and Maumy (2024) https://hal.science/hal-05371803, https://hal.science/hal-05371795 and https://hal.science/hal-05371798.
Maintainer: Frederic Bertrand [email protected] (ORCID)
Authors:
Elizaveta Logosha [email protected]
Myriam Maumy-Bertrand [email protected] (ORCID)
Elizaveta Logosha, Myriam Maumy, Frederic Bertrand; Confidence interval determination using discrete event simulations for real estate sales case. AIP Conf. Proc. 31 March 2025; 3182 (1): 100008. doi:10.1063/5.0246026.
Elizaveta Logosha, Myriam Maumy, Frédéric Bertrand; Sensitivity analysis of stochastic simulator in the case of sales date prediction. AIP Conf. Proc. 31 March 2025; 3182 (1): 100001. doi:10.1063/5.0246024.
Frédéric Bertrand, Elizaveta Logosha, Myriam Maumy-Bertrand. Extension of sensitivity analysis to uncertainties in distribution parameters. 32nd Conference on Intelligent Systems for Molecular Biology, International Society for Computational Biology, Jul 2024, Montreal (QC), Canada. https://hal.science/hal-05371795.
Frédéric Bertrand, Elizaveta Logosha, Myriam Maumy-Bertrand. Sobol4RV: Global Sensitivity Analysis in Several Random Settings. BioC 2024, BioConductor, Jul 2024, Grand Rapids, MI, United States. https://hal.science/hal-05371803
Frédéric Bertrand, Elizaveta Logosha, Myriam Maumy-Bertrand. Global Sensitivity Analysis in Several Random Settings. 2024 Joint Statistical Meetings, American Statistical Association, Aug 2024, Portland (OR), United States. https://hal.science/hal-05371798.
sobol4r_design(), sobol4r_qoi_indices(),
vignette("Sobol_RV_five_examples", package = "Sobol4R"),
vignette("Sobol4R_vignette_stochastic", package = "Sobol4R"),
vignette("Sobol4R_vignette_process", package = "Sobol4R") and
vignette("simmer_MM1_Sobol_example", package = "Sobol4R").
ex1_results <- sobol_example_g_deterministic(n=100, nboot=10) print(ex1_results) autoplot(ex1_results, ncol = 1) rm(ex1_results)ex1_results <- sobol_example_g_deterministic(n=100, nboot=10) print(ex1_results) autoplot(ex1_results, ncol = 1) rm(ex1_results)
Provide a ggplot visualisation when ggplot2 is available, otherwise fallback
to a lightweight base R bar chart. Supports the custom sobol_result class
used in this package, compact sobol_summary data frames, and
sensitivity::sobol objects.
autoplot(object, ...) ## S3 method for class 'sobol_result' autoplot( object, show_uncertainty = FALSE, probs = c(0.1, 0.9), bootstrap = 200L, ... ) ## S3 method for class 'sobol' autoplot(object, separate_panels = TRUE, ncol = 2, ...) ## S3 method for class 'sobol2007' autoplot(object, ...) ## S3 method for class 'soboljansen' autoplot(object, ...) ## S3 method for class 'sobolEff' autoplot(object, ...) ## S3 method for class 'sobolmartinez' autoplot(object, ...) ## S3 method for class 'sobol_summary' autoplot(object, ...)autoplot(object, ...) ## S3 method for class 'sobol_result' autoplot( object, show_uncertainty = FALSE, probs = c(0.1, 0.9), bootstrap = 200L, ... ) ## S3 method for class 'sobol' autoplot(object, separate_panels = TRUE, ncol = 2, ...) ## S3 method for class 'sobol2007' autoplot(object, ...) ## S3 method for class 'soboljansen' autoplot(object, ...) ## S3 method for class 'sobolEff' autoplot(object, ...) ## S3 method for class 'sobolmartinez' autoplot(object, ...) ## S3 method for class 'sobol_summary' autoplot(object, ...)
object |
A |
... |
Further arguments passed to the plotting backend. |
show_uncertainty |
Logical, when |
probs |
Numeric vector of probabilities used for the uncertainty bars. |
bootstrap |
Integer indicating how many bootstrap resamples to draw when
|
separate_panels |
Should the indices be plotted on separate
panels according to their order?
If |
ncol |
If |
A ggplot object when ggplot2 is installed, otherwise the
bar centres invisibly.
Recompute Sobol first- and total-order indices from stored sample matrices using bootstrap resampling. Falls back to deterministic values when no samples are available.
bootstrap_indices(result, bootstrap)bootstrap_indices(result, bootstrap)
result |
A |
bootstrap |
Integer indicating how many bootstrap replicates to draw. |
A list with matrices first and total containing the
bootstrap replications.
Convenient helper to compute the reliability-related probabilities described in Lebrun et al. (2021). The failure domain is controlled by a threshold and an inequality direction.
estimate_failure_probability(response, threshold, less = TRUE, weights = NULL)estimate_failure_probability(response, threshold, less = TRUE, weights = NULL)
response |
Numeric vector of simulator evaluations. |
threshold |
Numeric scalar defining the failure boundary. |
less |
Logical, failure is defined as |
weights |
Optional numeric vector of non-negative weights. The vector is normalised internally when supplied. |
A list containing the estimated probability and its variance.
y <- rnorm(1000) estimate_failure_probability(y, threshold = -1)y <- rnorm(1000) estimate_failure_probability(y, threshold = -1)
C++ implementation of the Ishigami function that is widely used as a benchmark for Sobol sensitivity indices. The implementation is vectorised and therefore convenient for Monte Carlo experiments.
ishigami_model(x, a = 7, b = 0.1)ishigami_model(x, a = 7, b = 0.1)
x |
Numeric matrix with three columns representing the inputs. |
a |
Numeric scalar controlling the nonlinear term. |
b |
Numeric scalar controlling the interaction term. |
Numeric vector of simulator outputs.
x <- matrix(runif(30, -pi, pi), ncol = 3) ishigami_model(x)x <- matrix(runif(30, -pi, pi), ncol = 3) ishigami_model(x)
Stochastic model that simulates successive units until M successes occur, and returns the time when the M-th success happens.
process_fun_indiv(X_indiv, M = 50)process_fun_indiv(X_indiv, M = 50)
X_indiv |
Numeric vector |
M |
Target number of successes. |
Scalar time to M successes, with attribute "success".
For each row of X, evaluates process_fun_row_wise several times
and returns the mean time to M successes.
process_fun_mean_to_M(X, M = 50, nrep = 10)process_fun_mean_to_M(X, M = 50, nrep = 10)
X |
Matrix or data.frame of parameters. |
M |
Target number of successes. |
nrep |
Number of repetitions for the QoI. |
Numeric vector of QoI values.
Applies process_fun_indiv row-wise to a matrix of parameters.
process_fun_row_wise(X, M = 50)process_fun_row_wise(X, M = 50)
X |
Matrix or data.frame with columns
|
M |
Target number of successes. |
Numeric vector of length nrow(X).
Generate the two-sample matrices (A and B) that are required to apply Monte Carlo Sobol estimators. The helper can rely on pseudo random numbers or on a light-weight Halton low-discrepancy sequence to increase coverage.
sobol_design( n, d, lower = rep(0, d), upper = rep(1, d), quasi = FALSE, seed = NULL )sobol_design( n, d, lower = rep(0, d), upper = rep(1, d), quasi = FALSE, seed = NULL )
n |
Integer, number of rows per design matrix. |
d |
Integer, number of model parameters. |
lower |
Numeric vector of length d containing lower bounds. |
upper |
Numeric vector of length d containing upper bounds. |
quasi |
Logical, when |
seed |
Optional integer used to initialise the RNG state. |
A list with matrices A and B plus the column names.
design <- sobol_design(n = 64, d = 3, quasi = TRUE) str(design)design <- sobol_design(n = 64, d = 3, quasi = TRUE) str(design)
Third input C3 is uniform on [1, 100], used as the mean of a Gaussian noise term added to the G-function. Quantity of interest is the mean of repeated evaluations.
sobol_example_covariate_large( n = 50000, nrep_qoi = 1000, order = 2, nboot = 100 )sobol_example_covariate_large( n = 50000, nrep_qoi = 1000, order = 2, nboot = 100 )
n |
Monte Carlo sample size for each base design. |
nrep_qoi |
Number of repetitions for the QoI. |
order |
Maximum interaction order. |
nboot |
Number of bootstrap replicates. |
A list with two "sobol" objects:
x_single (single noisy run),
x_qoi (QoI-based indices).
Same as sobol_example_covariate_large but with C3 uniform
on [1, 1.5], that is with a much smaller range for the mean of the
Gaussian noise.
sobol_example_covariate_small( n = 50000, nrep_qoi = 1000, order = 2, nboot = 100 )sobol_example_covariate_small( n = 50000, nrep_qoi = 1000, order = 2, nboot = 100 )
n |
Monte Carlo sample size for each base design. |
nrep_qoi |
Number of repetitions for the QoI. |
order |
Maximum interaction order. |
nboot |
Number of bootstrap replicates. |
A list with two "sobol" objects:
x_single (single noisy run),
x_qoi (QoI-based indices).
Reproduces the classical non-random Sobol analysis on the G-function with k = 8 inputs on [0, 1].
sobol_example_g_deterministic( n = 50000, a = c(0, 1, 4.5, 9, 99, 99, 99, 99), order = 2, nboot = 100 )sobol_example_g_deterministic( n = 50000, a = c(0, 1, 4.5, 9, 99, 99, 99, 99), order = 2, nboot = 100 )
n |
Monte Carlo sample size for each base design. |
a |
Parameter vector for the G-function. |
order |
Maximum interaction order for Sobol indices. |
nboot |
Number of bootstrap replicates. |
An object of class "sobol".
Computes Sobol indices for the simple process example with random distributional parameters. Uses both a single trajectory and a QoI based on repeated runs.
sobol_example_process(n = 100, M = 50, nrep_qoi = 10, order = 1, nboot = 10)sobol_example_process(n = 100, M = 50, nrep_qoi = 10, order = 1, nboot = 10)
n |
Monte Carlo sample size for each base design. |
M |
Target number of successes. |
nrep_qoi |
Number of repetitions for the QoI. |
order |
Maximum interaction order. |
nboot |
Number of bootstrap replicates. |
A list with two "sobol" objects:
xp_single and xp_qoi.
Two inputs in [0, 1], Sobol G-function with k = 2, plus additive Gaussian noise, and a QoI based on the mean of repeated evaluations.
sobol_example_random_output( n = 50000, sd = 1, nrep_qoi = 1000, order = 2, nboot = 100 )sobol_example_random_output( n = 50000, sd = 1, nrep_qoi = 1000, order = 2, nboot = 100 )
n |
Monte Carlo sample size for each base design. |
sd |
Standard deviation of the Gaussian noise. |
nrep_qoi |
Number of repetitions for the QoI. |
order |
Maximum interaction order. |
nboot |
Number of bootstrap replicates. |
A list with three "sobol" objects:
x_det (deterministic G-function),
x_noise (single noisy output),
x_qoi (QoI-based indices).
Generic implementation of the Sobol G-function for k inputs.
Columns of X are interpreted as inputs X1, X2, ..., Xk.
sobol_g_function(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g_function(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame of inputs in [0, 1]. |
a |
Numeric vector of parameters a_j controlling importance.
Its length must be at least |
Numeric vector of length nrow(X) with model outputs.
Generic implementation of the Sobol G-function for k inputs.
Columns of X are interpreted as inputs X1, X2, ..., Xk.
sobol_g_R(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g_R(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame of inputs in [0, 1]. |
a |
Numeric vector of parameters a_j controlling importance.
Its length must be at least |
Numeric vector of length nrow(X) with model outputs.
Additive Gaussian noise on the Sobol G-function (k = 2) - C++ backend
sobol_g2_additive_noise(X, sd = 1, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g2_additive_noise(X, sd = 1, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame with at least two columns. |
sd |
Standard deviation of the Gaussian noise. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of model outputs with noise.
Additive Gaussian noise on the Sobol G-function (k = 2)
sobol_g2_additive_noise_R(X, sd = 1, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g2_additive_noise_R(X, sd = 1, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame with at least two columns. |
sd |
Standard deviation of the Gaussian noise. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of model outputs with noise.
Convenience wrapper around sobol_g_function that uses
only the first two columns of X.
sobol_g2_function(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g2_function(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame with at least two columns. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of length nrow(X) with model outputs.
Computes a mean over repeated evaluations of the noisy model.
sobol_g2_qoi_covariate_mean( X, nrep = 1000, a = c(0, 1, 4.5, 9, 99, 99, 99, 99) )sobol_g2_qoi_covariate_mean( X, nrep = 1000, a = c(0, 1, 4.5, 9, 99, 99, 99, 99) )
X |
Numeric matrix or data.frame with at least two columns. |
nrep |
Number of replicates used for the QoI. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of QoI values (means over nrep runs).
Computes a mean over repeated evaluations of the noisy model.
sobol_g2_qoi_covariate_mean_R( X, nrep = 1000, a = c(0, 1, 4.5, 9, 99, 99, 99, 99) )sobol_g2_qoi_covariate_mean_R( X, nrep = 1000, a = c(0, 1, 4.5, 9, 99, 99, 99, 99) )
X |
Numeric matrix or data.frame with at least two columns. |
nrep |
Number of replicates used for the QoI. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of QoI values (means over nrep runs).
Computes a mean over repeated evaluations of the noisy model.
sobol_g2_qoi_mean(X, nrep = 1000, sd = 1, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g2_qoi_mean(X, nrep = 1000, sd = 1, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame with at least two columns. |
nrep |
Number of replicates used for the QoI. |
sd |
Standard deviation of the Gaussian noise. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of QoI values (means over nrep runs).
Computes a mean over repeated evaluations of the noisy model.
sobol_g2_qoi_mean_R( X, nrep = 1000, sd = 1, a = c(0, 1, 4.5, 9, 99, 99, 99, 99) )sobol_g2_qoi_mean_R( X, nrep = 1000, sd = 1, a = c(0, 1, 4.5, 9, 99, 99, 99, 99) )
X |
Numeric matrix or data.frame with at least two columns. |
nrep |
Number of replicates used for the QoI. |
sd |
Standard deviation of the Gaussian noise. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of QoI values (means over nrep runs).
Convenience wrapper around sobol_g_function that uses
only the first two columns of X.
sobol_g2_R(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g2_R(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame with at least two columns. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of model outputs.
Covariate dependent Gaussian noise on the Sobol G-function (k = 2) - C++ backend
sobol_g2_with_covariate_noise(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g2_with_covariate_noise(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame with at least two columns. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of model outputs with noise.
Additive Gaussian noise on the Sobol G-function (k = 2)
sobol_g2_with_covariate_noise_R(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))sobol_g2_with_covariate_noise_R(X, a = c(0, 1, 4.5, 9, 99, 99, 99, 99))
X |
Numeric matrix or data.frame with at least two columns. |
a |
Numeric vector of parameters (at least length 2). |
Numeric vector of model outputs with noise.
Estimate first-order and total-order Sobol indices using Monte Carlo estimators that support noisy outputs via independent replicates.
sobol_indices( model, design, replicates = 1L, estimator = c("jansen", "saltelli"), keep_samples = FALSE, ... )sobol_indices( model, design, replicates = 1L, estimator = c("jansen", "saltelli"), keep_samples = FALSE, ... )
model |
Function receiving a numeric matrix and returning a numeric vector of responses. The function may include internal randomness. |
design |
Output of |
replicates |
Integer, number of repeated evaluations to average out the model noise. Defaults to one replicate (deterministic behaviour). |
estimator |
Character string, either |
keep_samples |
When |
... |
Further arguments passed to |
Two families of estimators are available:
"saltelli": Saltelli-type estimator with internal centering
of the model outputs before variance and index computation.
"jansen": Jansen-type estimator based on variances of
output differences, which is numerically stable in many settings.
An object of class sobol_result containing the indices,
intermediate estimates, and the Monte Carlo variance.
design <- sobol_design(n = 128, d = 3, quasi = TRUE) model <- function(x) ishigami_model(x) result <- sobol_indices(model, design, replicates = 4) result$datadesign <- sobol_design(n = 128, d = 3, quasi = TRUE) model <- function(x) ishigami_model(x) result <- sobol_indices(model, design, replicates = 4) result$data
Transform stored simulator samples into Sobol indices for the binary failure
indicator described by Lebrun et al. (2021). The function reuses the
Saltelli-type estimator from sobol_indices() and therefore requires a
previous call with keep_samples = TRUE.
sobol_reliability(result, threshold, less = TRUE)sobol_reliability(result, threshold, less = TRUE)
result |
Output of |
threshold |
Numeric scalar defining the failure boundary. |
less |
Logical, when |
A sobol_result instance storing the Sobol indices of the failure
indicator along with the estimated failure probability and its variance.
design <- sobol_design(n = 128, d = 3, lower = rep(-pi, 3), upper = rep(pi, 3)) stochastic <- sobol_indices(ishigami_model, design, replicates = 3, keep_samples = TRUE) failure <- sobol_reliability(stochastic, threshold = -1) Sobol4R::autoplot(failure, show_uncertainty = TRUE)design <- sobol_design(n = 128, d = 3, lower = rep(-pi, 3), upper = rep(pi, 3)) stochastic <- sobol_indices(ishigami_model, design, replicates = 3, keep_samples = TRUE) failure <- sobol_reliability(stochastic, threshold = -1) Sobol4R::autoplot(failure, show_uncertainty = TRUE)
Simulate a simple clinic with separate registration and examination stages
using simmer. The quantity of interest is the mean time in system over
nrep replications for each parameter set.
sobol4r_clinic_model( X, cap_reg = 2, cap_exam = 3, horizon = 2000, warmup_prob = 0.2, nrep = 10L )sobol4r_clinic_model( X, cap_reg = 2, cap_exam = 3, horizon = 2000, warmup_prob = 0.2, nrep = 10L )
X |
Design matrix or data.frame with columns |
cap_reg, cap_exam
|
Integer capacities for the registration and examination resources. |
horizon |
Simulation horizon. |
warmup_prob |
Fraction of the horizon treated as warmup and discarded before computing the mean time in system. |
nrep |
Number of replications used to average the mean time in system. |
Numeric vector of length nrow(X).
Simple helper that wraps sensitivity::sobol with model = NULL
to create the extended design matrix used to evaluate the model.
sobol4r_design( X1, X2, order = 2, nboot = 0, type = c("soboljansen", "sobol", "sobol2007", "sobolEff", "sobolmartinez"), ... )sobol4r_design( X1, X2, order = 2, nboot = 0, type = c("soboljansen", "sobol", "sobol2007", "sobolEff", "sobolmartinez"), ... )
X1 |
First sample (matrix or data.frame). |
X2 |
Second sample (matrix or data.frame). |
order |
Maximum interaction order (1 or 2). |
nboot |
Number of bootstrap replicates for confidence intervals. |
type |
Type of Monte Carlo Estimation of Sobol' Indices to be used.
Supported estimators mirror the sensitivity helpers: |
... |
Additional arguments passed to |
An object of class "sobol" whose $X field contains
the design matrix. You should evaluate your model on $X and
then call sensitivity::tell().
Evaluate a simple M/M/1 queue built with simmer for each row of a
Sobol design matrix. The quantity of interest is the mean time in system
across nrep independent replications.
sobol4r_mm1_model(X, horizon = 1000, warmup = 200, nrep = 20L)sobol4r_mm1_model(X, horizon = 1000, warmup = 200, nrep = 20L)
X |
Design matrix or data.frame with columns |
horizon |
Simulation horizon. |
warmup |
Warmup period; arrivals ending before this time are discarded from the summary statistic. |
nrep |
Number of replications used to average the mean time in system. |
Numeric vector of length nrow(X).
This function extends the classical Sobol indices to a stochastic simulator by first computing a quantity of interest (QoI) for each input point, such as the mean of repeated runs.
sobol4r_qoi_indices( model, X1, X2, qoi_fun = base::mean, nrep = 1000, order = 2, nboot = 0, type = c("soboljansen", "sobol", "sobol2007", "sobolEff", "sobolmartinez"), ... )sobol4r_qoi_indices( model, X1, X2, qoi_fun = base::mean, nrep = 1000, order = 2, nboot = 0, type = c("soboljansen", "sobol", "sobol2007", "sobolEff", "sobolmartinez"), ... )
model |
Stochastic model function that takes a matrix or data.frame
|
X1, X2
|
Two base designs (matrices or data.frames). |
qoi_fun |
Function used to summarize the repetitions
(default is |
nrep |
Number of repetitions of the stochastic model for each design point. |
order |
Maximum interaction order (1 or 2). |
nboot |
Number of bootstrap replicates for Sobol indices. |
type |
Which estimator to use. Any sensitivity Sobol helper is
supported: |
... |
Additional arguments passed to |
An object of class "sobol" with QoI-based Sobol indices.
Helper around sensitivity::sobol that mimics the structure
of the original scripts. It never writes to disk.
sobol4r_run( model, X1, X2, order = 2, nboot = 100L, qoi_fun = NULL, nrep = 1L, type = c("soboljansen", "sobol", "sobol2007", "sobolEff", "sobolmartinez"), ... )sobol4r_run( model, X1, X2, order = 2, nboot = 100L, qoi_fun = NULL, nrep = 1L, type = c("soboljansen", "sobol", "sobol2007", "sobolEff", "sobolmartinez"), ... )
model |
Deterministic or stochastic model that takes a design X and returns a numeric vector of length nrow(X). |
X1, X2
|
Matrices or data.frames used to build the Sobol design. |
order |
Order of the Sobol indices (1 or 2). |
nboot |
Number of bootstrap replicates for confidence intervals. |
qoi_fun |
Optional quantity of interest function. If not NULL, the model is evaluated repeatedly and QoI is computed row wise. |
nrep |
Number of replications per design row when |
type |
Type of Monte Carlo Estimation of Sobol' Indices to be used.
Supported estimators mirror the sensitivity helpers: |
... |
Extra arguments passed to |
A sobol object (output of sensitivity::tell).
Compute compact summaries of the Sobol indices and their Monte Carlo variability. The function is intended to feed diagnostic plots.
summarise_sobol(result, probs = c(0.1, 0.5, 0.9), bootstrap = 200L)summarise_sobol(result, probs = c(0.1, 0.5, 0.9), bootstrap = 200L)
result |
A |
probs |
Numeric vector of probabilities used to report quantiles of the empirical bootstrap distribution. |
bootstrap |
Integer, number of bootstrap resamples used to quantify the estimator uncertainty. |
A data frame (class sobol_summary) with the requested
statistics. Quantile columns are added when probs is not empty.
design <- sobol_design(n = 64, d = 3) model <- function(x) ishigami_model(x) sob <- sobol_indices(model, design, keep_samples = TRUE) summarise_sobol(sob, probs = c(0.1, 0.9))design <- sobol_design(n = 64, d = 3) model <- function(x) ishigami_model(x) sob <- sobol_indices(model, design, keep_samples = TRUE) summarise_sobol(sob, probs = c(0.1, 0.9))