model.optim.lsd {LSDsensitivity} | R Documentation |
Find optimal meta-model factor settings
Description
This function finds the optimal factor (parameter) settings using the estimated meta-model.
Usage
model.optim.lsd( model, data = NULL, lower.domain = NULL, upper.domain = NULL,
starting.values = NULL, minimize = TRUE, pop.size = 1000,
max.generations = 30, wait.generations = 10,
precision = 1e-05, nnodes = 1 )
Arguments
model |
an object created by a previous call to |
data |
an optional object created by a previous call to |
lower.domain |
an optional vector or single-line data frame which contains the minimum values to be considered for all the meta-model factors/variables. If |
upper.domain |
an optional vector or single-line data frame which contains the maximum values to be considered for all the meta-model factors/variables. If |
starting.values |
an optional vector or single-line data frame which contains the starting values to be used by |
minimize |
logical: set to FALSE to perform maximization. The default is TRUE (minimization). |
pop.size |
integer: the number of parallel search paths |
max.generations |
integer: the maximum number of generations that |
wait.generations |
integer: if there is no improvement in the objective function after this number of generations, |
precision |
numeric: the tolerance level used by |
nnodes |
integer: the maximum number of parallel computing nodes (parallel threads) in the current computer to be used for reading the files. The default, |
Details
This function searches for maximum and minimum response surface values by the application of a genetic algorithm (Sekhon & Walter, 1998).
The function can be used to perform any form of optimization by means the user defines the proper objective function to be maximized (or minimized). Any form of objective function can be easily defined as a new variable to the DoE data set when it is created by read.doe.lsd
.
This function is a wrapper to the function genoud
in rgenoud
package.
Value
The function returns a single-line data frame which contains values (in the rows) for all the meta-model factors/variables (in the columns) or NULL if optimization fails.
Author(s)
NA
References
Sekhon JS, Walter RM (1998). Genetic optimization using derivatives: theory and application to nonlinear models. Political Analysis 7:187-210
See Also
read.doe.lsd()
,
kriging.model.lsd()
,
polynomial.model.lsd()
Examples
# get the example directory name
path <- system.file( "extdata/sobol", package = "LSDsensitivity" )
# Steps to use this function:
# 1. define the variables you want to use in the analysis
# 2. load data from a LSD simulation saved results using read.doe.lsd
# 3. fit a Kriging (or polynomial) meta-model using kriging.model.lsd
# 4. find the factor configuration that produce the minimum (or maximum)
# value for the analysis variable defined in step 2
lsdVars <- c( "var1", "var2", "var3" ) # the definition of existing variables
dataSet <- read.doe.lsd( path, # data files folder
"Sim3", # data files base name (same as .lsd file)
"var3", # variable name to perform the sensitivity analysis
does = 2, # number of experiments (data + external validation)
saveVars = lsdVars ) # LSD variables to keep in dataset
model <- kriging.model.lsd( dataSet ) # estimate best Kriging meta-model
config <- model.optim.lsd( model, # find meta-model configuration for minimum response
dataSet ) # use the full range of factors and starting from
# calibration
print( config )