Description Author(s) References Examples
MTK is an R package for sensitivity analysis and numerical experiments . Three examples are provided:
"Ishigami" model analysis with the "BasicMonteCarlo" and "Regression" methods.
Using the "mtk" package from a XML file.
"WWDM (Winter Wheat Dry Matter)" model analysis with the "Morris" methods.
To run the examples, just load the package and type respectively:
demo(demo1,package="mtk", ask=FALSE)
demo(demo2,package="mtk", ask=FALSE)
demo(demo3,package="mtk", ask=FALSE)
The following methods and models are available for the current release:
The "Fast" methods for experiments design and sensitivity index calculation. see help(Fast)
.
The "Morris" methods for experiments design and sensitivity index calculation. see help(Morris)
.
The "Sobol" methods for experiments design and sensitivity index calculation. see help(Sobol)
.
The "Monte-Carlo" methods for experiments design. see help(BasiMonteCarlo)
.
The "LHS" methods for experiments design. see help(RandLHS)
.
The "PLMM (Polynomial Linear Meta-Model)" methods for sensitivity analysis. see help(PLMM)
.
The "Regression" methods for sensitivity index calculation. see help(Regression)
.
The "Ishigami" model for model simulation. see help(Ishigami)
.
The "WWDM (Winter Wheat Dry Matter)" model for model simulation. see help(WWDM)
.
The Mexico Group. Contact: Juhui WANG, MIA-Jouy, Juhui.Wang@jouy.inra.fr,
J. Wang, H. Richard, R. Faivre, H. Monod (2013). Le package mtk
, une bibliothèque R pour l'exploration numérique des modèles.
In: Analyse de sensibilité et exploration de modèles : Application aux sciences de la nature et de l'environnement
(R. Faivre, B. Iooss, S. Mahévas, D. Makowski, H. Monod, Eds). Editions Quae, Versailles.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | ### Example 1: Sensitivity analysis of the "Ishigami" model ###
# Specify the factors to analyze:
x1 <- make.mtkFactor(name="x1",
distribName="unif", distribPara=list(min=-pi, max=pi))
x2 <- make.mtkFactor(name="x2", distribName="unif",
distribPara=list(min=-pi, max=pi))
x3 <- make.mtkFactor(name="x3", distribName="unif",
distribPara=list(min=-pi, max=pi))
factors <- mtkExpFactors(list(x1,x2,x3))
# Build the processes:
# 1) the experimental design process with the method "Morris".
exp1.Designer <- mtkMorrisDesigner(listParameters
= list(r=20,type="oat",levels=4,grid.jump=2))
# 2) the model simulation process with the model "Ishigami".
exp1.Evaluator <- mtkIshigamiEvaluator()
# 3) the analysis process with the method "Morris".
exp1.Analyser <- mtkMorrisAnalyser()
# Build the workflow with the processes defined previously.
exp1 <- mtkExpWorkflow(expFactors=factors,
processesVector = c(
design=exp1.Designer,
evaluate=exp1.Evaluator,
analyze=exp1.Analyser)
)
# Run the workflow and reports the results.
run(exp1)
print(exp1)
# Create a new process with the analysis method «Regression».
exp1.AnalyserReg <- mtkRegressionAnalyser(listParameters
=list(nboot=20)
)
# Re-analyze the model "Ishigami" with the method "Regression":
## replace the process, run the workflow and report the results
setProcess(exp1, exp1.AnalyserReg, "analyze")
run(exp1)
print(exp1)
### Example 2 : Sensitivity analysis from a XML file ###
# # XML file is held in the directory of the library: "inst/extdata/"
# Specify the XML file's name
xmlFile <- "WWDM_morris.xml"
## Find where the examples are held.
xmlFilePath <- paste(path.package("mtk", quiet = TRUE),
"/extdata/",xmlFile,sep = "")
# Create the workflow
## Nota: If your XML file is local file for example "/var/tmp/X.xml",
## you should create the workflow as follows:
## workflow <- mtkExpWorkflow(xmlFilePath="/var/tmp/X.xml")
workflow <- mtkExpWorkflow(xmlFilePath=xmlFilePath)
# Run the workflow and report the results
run(workflow)
summary(workflow)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.