multisensi: A function with multiple options to perform multivariate...

Description Usage Arguments Value See Also Examples

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

1
2
3
4
5
6
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 N x P containing N combinations of levels of the P input factors OR a function from the sensitivity package such as fast99 OR an object generated by a function from the sensitivity package. The first and third cases require additional information to be given in the design.args argument.

model

EITHER a function to run the model simulations OR a data.frame of size N x T containing N realizations of T output variables.

reduction

EITHER a function to decompose the multivariate output on a basis of smaller dimension OR NULL. The first case requires additional information to be given in the basis.args argument. In the second case, sensitivity analyses are performed on the raw output variables.

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 analysis.args argument.

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 design argument.

basis.args

a list of arguments for the function given in the reduction argument. See the function help for more precision.

analysis.args

a list of arguments for the function possibly given in the analysis argument. See the function help for more precision.

...

optional parameters of the function possibly given in the model argument.

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

dynsi, gsi

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## 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)

multisensi documentation built on May 2, 2019, 2:14 p.m.