multisensi {multisensi} | R Documentation |
A function with multiple options to perform multivariate sensitivity analysis
Description
The multisensi
function can conduct the different steps of a multivariate sensitivity analysis (design, simulation, dimension reduction, analysis, plots). It includes different options for each of these steps.
Usage
multisensi(design = expand.grid, model, reduction = basis.ACP,
dimension = 0.95, center = TRUE, scale = TRUE,
analysis = analysis.anoasg, cumul = FALSE,
simulonly = FALSE, Name.File = NULL,
design.args = list(), basis.args = list(),
analysis.args = list(), ...)
Arguments
design |
EITHER a function such as expand.grid to generate the design OR a data.frame of size |
model |
EITHER a function to run the model simulations OR a data.frame of size |
reduction |
EITHER a function to decompose the multivariate output on a basis of smaller dimension OR |
dimension |
EITHER the number of variables to analyse, specified by an integer or by the minimal proportion of inertia (a scalar < 1) to keep in the output decomposition OR a vector specifying a subset of columns in the output data.frame OR NULL if all variables must be analysed. |
center |
logical value. If TRUE (default value) the output variables are centred. |
scale |
logical value. If TRUE (default value) the output variables are normalized before applying the reduction function. |
analysis |
a function to run the sensitivity analysis. Additional information can be given in the |
cumul |
logical value. If TRUE the output variables are replaced by their cumulative sums. |
simulonly |
logical value. If TRUE the program stops after the model simulations. |
Name.File |
Name of file containing the R-function model. |
design.args |
a list of arguments for the function possibly given in the |
basis.args |
a list of arguments for the function given in the |
analysis.args |
a list of arguments for the function possibly given in the |
... |
optional parameters of the function possibly given in the |
Value
an object of class dynsi
if reduction=NULL
, otherwise an object of class gsi
. See the functions dynsi
and gsi
for more information.
See Also
Examples
## Test case : the Winter Wheat Dynamic Models (WWDM)
# input factors design
data(biomasseX)
# input climate variable
data(Climat)
# output variables (precalculated to speed up the example)
data(biomasseY)
# to do dynsi process
# argument reduction=NULL
resD <- multisensi(design=biomasseX, model=biomasseY, reduction=NULL,
dimension=NULL, analysis=analysis.anoasg,
analysis.args=list(formula=2,keep.outputs = FALSE))
summary(resD)
# to do gsi process
#------------
# with dimension reduction by PCA
# argument reduction=basis.ACP
resG1 <- multisensi(design=biomasseX, model=biomasseY, reduction=basis.ACP,
dimension=0.95, analysis=analysis.anoasg,
analysis.args=list(formula=2,keep.outputs = FALSE))
summary(resG1)
plot(x=resG1, beside=FALSE)
#------------
# with dimension reduction by o-splines basis
# arguments reduction=basis.osplines
# and basis.args=list(knots= ... , mdegree= ... )
resG2 <- multisensi(design=biomasseX, model=biomasseY, reduction=basis.osplines,
dimension=NULL, center=FALSE, scale=FALSE,
basis.args=list(knots=11, mdegree=3), analysis=analysis.anoasg,
analysis.args=list(formula=2,keep.outputs = FALSE))
summary(resG2)
#------------
library(sensitivity) # to use fast99
# with dimension reduction by o-splines basis
# and sensitivity analysis with sensitivity:fast99
resG3 <- multisensi(design=fast99, model=biomasse,
analysis=analysis.sensitivity,
design.args=list(factors = names(biomasseX), n = 100,
q = "qunif", q.arg = list(list(min = 0.9, max = 2.8),
list(min = 0.9, max = 0.99), list(min = 0.6, max = 0.8),
list(min = 3, max = 12), list(min = 0.0035, max = 0.01),
list(min = 0.0011, max = 0.0025),
list(min = 700, max = 1100))), climdata=Climat,
reduction=basis.osplines,
basis.args=list(knots=7, mdegree=3),
center=FALSE,scale=FALSE,dimension=NULL)
summary(resG3)