# 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. estimate the meta-model response at any set of points applying
# model.pred.lsd
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
# creates a set of four random points in parameter space
points <- data.frame( par1 = rnorm( 4 ), par2 = rnorm( 4 ), par3 = rnorm( 4 ) )
response <- model.pred.lsd( points, model ) # predict model response at the 3 points
print( points )
print( response )
Run the code above in your browser using DataLab