# NOT RUN {
# 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)
# }
# NOT RUN {
library(rgl)
plot3d.morris(x) # (requires the package 'rgl')
# }
# NOT RUN {
# }
# NOT RUN {
# 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