morris
implements the Morris's elementary effects screening
method (Morris 1991). This method, based on design of experiments,
allows to identify the few important factors at a cost of $r
\times (p+1)$ simulations (where $p$ is the number
of factors). This implementation includes some improvements of the
original method: space-filling optimization of the design (Campolongo
et al. 2007) and simplex-based design (Pujol 2009).morris(model = NULL, factors, r, design, binf = 0, bsup = 1,
scale = TRUE, ...)
## S3 method for class 'morris':
tell(x, y = NULL, ...)
## S3 method for class 'morris':
print(x, ...)
## S3 method for class 'morris':
plot(x, identify = FALSE, atpen = FALSE, y_col = NULL,
y_dim3 = NULL, \dots)
## S3 method for class 'morris':
plot3d(x, alpha = c(0.2, 0), sphere.size = 1, y_col = NULL,
y_dim3 = NULL)
predict
method,
defining the model to analyze.c(r1, r2)
for the space-filling
improvement (Campolongo et al.). In this catype = "oat"
for Morris's OAT design (Morris 1991),
with the parameters:levels
: either an integer specifying the number of
levels of the desiTRUE
, the input design of experiments is
scaled after building the design and before computing the elementary
effects so that all factors vary within the range [0,1]. For each factor,
the scaling is done relativel"morris"
storing the state of the
screening study (parameters, data, estimates).TRUE
, the user selects with the
mouse the factors to label on the $(\mu^*,\sigma)$
graph (see identify
).TRUE
(and identify = TRUE
), the
user-identified labels (more precisely: their lower-left corners) of the
factors are plotted at the place where the user had clicked (if near enough
to one of the factx$y
to be
used for plotting the corresponding Morris statistics $\mu^*$
and $\sigma$ (only applies if x$y
is a matrix or an
array).
If set to NULL
(x$y
to be used for plotting the corresponding Morris statistics
$\mu^*$ and $\sigma$ (only applies if x$y
is an
array).
If set to NULL
(argl.material
). The first value is for the
cone, the second for the planes.morris
: any other arguments for model
which
are passed unchanged each time it is called. For plot.morris
:
arguments to be passed to plot.default
.morris
returns a list of class "morris"
, containing all
the input argument detailed before, plus the following components:data.frame
containing the design of experiments.model
).y
is a vector: a$(r \times p)$- matrix of
elementary effects for all the factors.y
is a matrix: a
$(r \times p \times ncol(y))$ - array of
elementary effects for all the factors and all columns of y
.y
is a three-dimensional array: a
$(r \times p \times dim(y)[2] \times dim(y)[3])$ - array of elementary effects for all
the factors and all elements of the second and third dimension of
y
.scale = TRUE
plot.morris
draws the $(\mu^*,\sigma)$ graph.
plot3d.morris
draws the $(\mu, \mu^*,\sigma)$ graph (requires the morris
also supports matrices and three-dimensional
arrays as output of model
.# Test case : the non-monotonic function of Morris
x <- morris(model = morris.fun, factors = 20, r = 4,
design = list(type = "oat", levels = 5, grid.jump = 3))
print(x)
plot(x)
library(rgl)
plot3d.morris(x) # (requires the package 'rgl')
# Only for demonstration purposes: a model function returning a matrix
morris.fun_matrix <- function(X){
res_vector <- morris.fun(X)
cbind(res_vector, 2 * res_vector)
}
x <- morris(model = morris.fun_matrix, factors = 20, r = 4,
design = list(type = "oat", levels = 5, grid.jump = 3))
plot(x, y_col = 2)
title(main = "y_col = 2")
# Also only for demonstration purposes: a model function returning a
# three-dimensional array
morris.fun_array <- function(X){
res_vector <- morris.fun(X)
res_matrix <- cbind(res_vector, 2 * res_vector)
array(data = c(res_matrix, 5 * res_matrix),
dim = c(length(res_vector), 2, 2))
}
x <- morris(model = morris.fun_array, factors = 20, r = 4,
design = list(type = "simplex", scale.factor = 1))
plot(x, y_col = 2, y_dim3 = 2)
title(main = "y_col = 2, y_dim3 = 2")
Run the code above in your browser using DataLab