mtk-package: MTK (Mexico ToolKit) for Sensitivity Analysis and Numerical...

Description Author(s) References Examples

Description

MTK is an R package for sensitivity analysis and numerical experiments . Three examples are provided:

To run the examples, just load the package and type respectively:

The following methods and models are available for the current release:

Author(s)

The Mexico Group. Contact: Juhui WANG, MIA-Jouy, Juhui.Wang@jouy.inra.fr,

References

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.

Examples

 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)

mtk documentation built on May 2, 2019, 4:15 a.m.