get_sensitivity {COINr}R Documentation

Sensitivity and uncertainty analysis of a coin


This function performs global sensitivity and uncertainty analysis of a coin. You must specify which parameters of the coin to vary, and the alternatives/distributions for those parameters.


  SA_type = "UA",
  Nboot = NULL,
  quietly = FALSE,
  check_addresses = TRUE



A coin


Specifications of the input uncertainties


The number of regenerations


The type of analysis to run. "UA" runs an uncertainty analysis. "SA" runs a sensitivity analysis (which anyway includes an uncertainty analysis).


The data set to extract the target variable from (passed to get_data()).


The variable within dset to use as the target variable (passed to get_data()).


Number of bootstrap samples to take when estimating confidence intervals on sensitivity indices.


Set to TRUE to suppress progress messages.


Logical: if FALSE skips the check of the validity of the parameter addresses. Default TRUE, but useful to set to FALSE if running this e.g. in a Rmd document (because may require user input).


COINr implements a flexible variance-based global sensitivity analysis approach, which allows almost any assumption to be varied, as long as the distribution of alternative values can be described. Variance-based "sensitivity indices" are estimated using a Monte Carlo design (running the composite indicator many times with a particular combination of input values). This follows the methodology described in doi:10.1111/j.1467-985X.2005.00350.x.

To understand how this function works, please see vignette("sensitivity"). Here, we briefly recap the main input arguments.

First, you can select whether to run an uncertainty analysis SA_type = "UA" or sensitivity analysis SA_type = "SA". The number of replications (regenerations of the coin) is specified by N. Keep in mind that the total number of replications is N for an uncertainty analysis but is N*(d + 2) for a sensitivity analysis due to the experimental design used.

To run either types of analysis, you must specify which parts of the coin to vary and what the distributions/alternatives are This is done using SA_specs, a structured list. See vignette("sensitivity") for details and examples.

You also need to specify the target of the sensitivity analysis. This should be an indicator or aggregate that can be found in one of the data sets of the coin, and is specified using the dset and iCode arguments.

Finally, if SA_type = "SA", it is advisable to set Nboot to e.g. 100 or more, which is the number of bootstrap samples to take when estimating confidence intervals on sensitivity indices. This does not perform extra regenerations of the coin, so setting this to a higher number shouldn't have much impact on computational time.

This function replaces the now-defunct sensitivity() from COINr < v1.0.


Sensitivity analysis results as a list, containing:


# for examples, see `vignette("sensitivity")`
# (this is because package examples are run automatically and this function can
# take a few minutes to run at realistic settings)

[Package COINr version 1.1.7 Index]