kriging.model.lsd {LSDsensitivity} | R Documentation |
Fit a Kriging meta-model to a LSD model sample data
Description
This function fits a Kriging meta-model (also known as a Gaussian process), using five alternative variance kernels and two trend model options, to the sampled data from a LSD simulation model.
Usage
kriging.model.lsd( data, ext.wgth = 0.5, trendModel = 0, covModel = 0,
digits = 4 )
Arguments
data |
an object created by a previous call to |
ext.wgth |
numeric in [0, 1]: the weight given to the fitting metrics calculated over the out-of-sample (external) validation sample in regard to the in-sample metrics. The default value is 0.5. |
trendModel |
a number corresponding to the trend model: 0 = automatic selection (according to fitting metrics, the default); 1 = constant; 2 = first order polynomial. |
covModel |
a number corresponding to the covariance model (or kernel): 0 = automatic selection (according to fitting metrics, the default); 1 = Matern 5/2; 2 = Matern 3/2; 3 = Gaussian; 4 = exponential; 5 = power exponential. |
digits |
integer: the number of significant digits to show in results. The default is 4. |
Details
This function fits a universal Kriging meta-model to the experimental data set previously loaded with read.doe.lsd
using the Gaussian process method (Rasmussen & Williams, 2006).
This function is a wrapper to the function km
in DiceKriging-package
.
Value
The function returns an object/list of class kriging-model
containing several items:
selected |
an object containing the selected estimated meta-model (standardized). |
comparison |
a print-ready table with all fitting statistics for all fitted meta-model specifications. |
Q2 |
the Q2 in-sample fitting statistic for the selected meta-model. |
rmse |
the RMSE out-of-sample fitting statistic for the selected meta-model. |
mae |
the MAE out-of-sample fitting statistic for the selected meta-model. |
rma |
the RMA out-of-sample fitting statistic for the selected meta-model. |
extN |
number of out-of-sample observations. |
estimation |
a print-ready table with the coefficients (hyper-parameters) of the selected estimated meta-model. |
estimation.std |
a print-ready table with the standardized coefficients (hyper-parameters) of the selected estimated meta-model. |
coefficients |
a vector with the coefficients (hyper-parameters) of the selected estimated meta-model. |
coefficients.std |
a vector with the standardized coefficients (hyper-parameters) of the selected estimated meta-model. |
trend |
number of the selected trend model. |
trendNames |
name of the selected trend model. |
cov |
number of the selected covariance model (kernel). |
covNames |
name of the selected covariance model (kernel). |
Note
See the note in LSDsensitivity-package for step-by-step instructions on how to perform the complete sensitivity analysis process using LSD and R.
Author(s)
NA
References
Kleijnen JP (2009) Kriging metamodeling in simulation: a review. Eur J Oper Res 192(3):707-716
Rasmussen C, Williams C (2006) Gaussian processes for machine learning. MIT Press, Cambridge
Roustant O, Ginsbourger D, Deville Y (2012) Dicekriging, diceoptim: two R packages for the analysis of computer experiments by kriging-based metamodeling and optimization. J Stat Softw 51(1):1-55
See Also
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,
# preferrably using two sets of sampled data (DoEs), one for model
# estimation and the other for out-of-sample (external) validation
# 3. fit a Kriging (or polynomial) meta-model using kriging.model.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
print( model$comparison ) # model comparison table
print( model$estimation.std ) # model estimation (standardized) table