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 kriging.model.lsd or polynomial.model.lsd which contains the meta-model estimated hyper-parameters.

data

an optional object created by a previous call to read.doe.lsd which sets the default values for lower.domain, upper.domain and starting.values.

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 data is not provided, the default values are the lower limit ranges from the .sa file set in LSD.

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 data is not provided, the default values are the upper limit ranges from the .sa file set in LSD.

starting.values

an optional vector or single-line data frame which contains the starting values to be used by genoud for all the meta-model factors/variables. If data is provided, the default values are the calibration settings from the baseline configuration .lsd file set in LSD.

minimize

logical: set to FALSE to perform maximization. The default is TRUE (minimization).

pop.size

integer: the number of parallel search paths genoud uses to solve the optimization problem. The default is 1000.

max.generations

integer: the maximum number of generations that genoud will run when attempting to optimize a function. The default is 30.

wait.generations

integer: if there is no improvement in the objective function after this number of generations, genoud will accept the optimum. The default is 10.

precision

numeric: the tolerance level used by genoud. Numbers within precision are considered to be equal. The default is 1e-5.

nnodes

integer: the maximum number of parallel computing nodes (parallel threads) in the current computer to be used for reading the files. The default, nnodes = 1, means single thread processing (no parallel threads). If equal to zero, creates up to one node per CPU (physical) core. Only Fork clusters can be used, because PSOCK clusters are not working now, so this option is not available in Windows. Please note that each node requires its own memory space, so memory usage increases linearly with the number of nodes.

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()

genoud

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 )


[Package LSDsensitivity version 1.2.3 Index]