# dexisensitivity: An R package to perform sensitivity analyses of DEXi models

Roland Allart, Aude Alaphilippe, Marta Carpani, Nicolas Cavan, Hervé Monod, Jacques-Eric Bergez

► To cite this version:

Roland Allart, Aude Alaphilippe, Marta Carpani, Nicolas Cavan, Hervé Monod, et al.. dexisensitivity: An R package to perform sensitivity analyses of DEXi models. Software Impacts, 2025, 23, pp.100729. 10.1016/j.simpa.2024.100729. hal-04865294

HAL Id: hal-04865294

https://hal.science/hal-04865294v1

Submitted on 6 Jan 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Original software publication

dексisensitivity: An R package to perform sensitivity analyses of DEXi models

Roland Allart<sup>a</sup>, Aude Alaphilippe<sup>b</sup>, Marta Carpani<sup>a</sup>, Nicolas Cavan<sup>d</sup>, Hervé Monod<sup>c</sup>,
Jacques-Eric Bergez<sup>a,*</sup>

<figure><img src="image_2.png" /></figure>

Check for
updates

ARTICLE INFO

Keywords:

DEXi models

Sensitivity analysis

Qualitative hierarchical models

A B S T R A C T

DEXi is a software for developing qualitative hierarchical models. Widely used in the French agriculture sector to analyze the sustainability of farming systems, the sensitivity analyses of the models are still missing. The *dексisensitivity* R package performs such sensitivity analyses. Written using R S4 Object programming, it performs basic functions (reads DEXi models, describes and draws the models, generates and simulates scenarios) and other functions to perform different types of sensitivity analyses: analysis of variance, One-At-A-Time, sensitivity indexes using the Shapiro-Shapley approach... The *dексisensitivity* R package is distributed under the GPL license and is accessible from CRAN and GitHub.

Code metadata

Current code version

Permanent link to code/repository used for this code version

Permanent link to reproducible capsule

Legal code license

Code versioning system used

Software code languages, tools and services used

Compilation requirements, operating environments and dependencies

If available, link to developer documentation/manual

Email support for questions

1.0.1

https://github.com/SoftwareImpacts/SIMPAC-2024-265

GPL >= 2

Git

R

R version >= 4.1

https://cran.r-project.org/web/packages/dексisensitivity/dексisensitivity.pdf

nicolas.cavan@inrae.fr

roland.allart@inrae.fr

1. Introduction

In the agricultural sector, the analysis of the sustainability of pro-
duction systems is a very important challenge [1]. In recent years,
different authors have developed models to perform ex-ante and ex-
post analysis of some production systems using the DEXi approach [2–
4]. DEXi (http://www-ai.ijs.si/MarkoBohanec/dexi.html) is a decision-
support-system software based on DEX methodology, whose original
feature is that it deals with qualitative multicriteria models. These
models include the MASC model [5] and the DEXiPM [6] for arable
cropping systems, the OFSAT model for organic production systems
[7] and the SustainOS for apple orchards [8]. A general guideline
on how to develop such models has been published [9]. However,
these models, as is the case for the other numerical models, requires a

thorough sensitivity analysis to develop confidence in the model before
its use. Carpani et al. [10] developed some functions to deal with
these sensitivity analysis processes. However, a full comprehensive and
documented package was missing.

This paper presents the *dексisensitivity* R package that makes it possi-
ble to perform different sensitivity analyses on models developed using
DEXi software. We used agricultural examples. However, all models
developed with DEXi can be analyzed.

2. The structure of DEXi models

DEXi is a decision-support-system software based on DEX methodol-
ogy. It was developed to create qualitative multicriteria models [2]. It

<footnote><sup>a</sup>AGIR, Université de Toulouse, INRAE, F-31326 Castanet-Tolosan, France</footnote>

<footnote><sup>b</sup> UERI, INRAE, F-26320 Saint-Marcel-Lès-Valence, France</footnote>

<footnote><sup>c</sup> MIA, INRAE, F-78352 Jouy en Josas Cedex, France</footnote>

<footnote><sup>d</sup>Agroécologie, INRAE, Institut Agro, Université Bourgogne, Université Bourgogne Franche-Comté, F-21000 Dijon, France</footnote>

<footnote>* Corresponding author.</footnote>

<footnote>E-mail address: jacques-eric.bergez@inrae.fr (J.-E. Bergez).</footnote>

<footnote>https://doi.org/10.1016/j.simpa.2024.100729</footnote>

<footnote>Received 28 October 2024; Received in revised form 3 December 2024; Accepted 3 December 2024</footnote>

<footnote>2665-9638/© 2024 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license
(http://creativecommons.org/licenses/by/4.0/).</footnote>
<figure><img src="image_3.png" /><figcaption>**Fig. 1.** General structure of a DEXi model. (a) A complex problem (Z) is decomposed into different dimensions (Y) up to a data input level (L). “High”). DEX methodology makes it These data are qualitative. (b) The aggregation from L to Z is performed thanks to decision tables.</figcaption></figure>

combines a hierarchical decision model with an expert-system approach based on qualitative criteria whose values are discrete and usually take the form of words rather than numbers (e.g., “Low”, “Medium”, “High”). DEX methodology makes it possible to break down a decisional problem (the most aggregated criterion; Z in Fig. 1) into smaller, less complex sub-problems represented by criteria ($Y_i$ in Fig. 1). A set of input data ($L_i$ in Fig. 1) is referred to as a scenario that has to be simulated. The DEXi interface makes it easy to create models with different stakeholders. Models developed using the DEXi interface are saved as .xml files.

## 3. Software description

<figure><img src="image_4.png" /></figure>

<figure><img src="image_5.png" /></figure>

### 3.1. Functionalities

#### 3.1.1. Basic functionalities

The *dексisensitivity* R package allows some basic manipulation of DEXi models:

* Reads a DEXi model and provides information about it. Since DEXi models are .xml-based, this function parses the .xml file and stores the information in a S4 object. It then creates the structure of the tree-like object and provides information about it: a graphical visualization of the tree, number of branches and leaves, number of repeated leaves, etc.

* Modifies elements of the structure: once the tree is created, the user can interact with all of the tree (model) elements such as aggregation weights and decision tables and can create sub trees from the main tree

* Creates and simulates scenarios: values for the different leaves can be created in order to simulate a scenario. Outputs can be presented in a graph.

#### 3.1.2. Sensitivity analysis functionalities

The *dексisensitivity* R package allows the use of different sensitivity analysis methods (for the description of the statistical approaches, see Carpani et al. [10]):

* Analysis of variance using partial decomposition of the variance

* Monte-Carlo sampling with random draw of leaves

* Shapley-Shapiro sensitivity index using the specific structure of the model (monotonic model)

* One-At-A-Time analysis

<figure><img src="image_6.png" /></figure>

<figure><img src="image_7.png" /><figcaption>**Fig. 2.** Use of the *dексisensitivity* R package. The MASC model has been used as an example [5]. (a) After reading the .xml, check the model; (b) A Monte-Carlo sampling method to analyze the distribution of the output variables; (c) The sensitivity index after using the Shapley-Shapiro approach; (d) Simulating a scenario and presenting the results in a dashboard approach.</figcaption></figure>
### 3.1.3. Typical use of the package

Typical use of the package consists of: (1) Loading a DEXi model created under DEXi software; (2) Checking that the reading has been correctly performed; (3) Running a sensitivity analysis; (4) If the results are not satisfactory, modifying the decision tables and rerunning the sensitivity analysis; and (5) Once the model is properly calibrated, running the scenario analysis (see Fig. 2).

### 3.2. Development

The package was developed using the R S4 OOP approach (R core Team 2022) to represent the Tree. The *dексisensitivity* R package follows the modern conventions of open source software development. The project is hosted on GitHub. The *dексisensitivity* R package is also available from the Comprehensive R Archive Network (CRAN) for easy installation and use. Distribution through CRAN requires including working examples for every function after checks. It plays the role of integration testing when the package is updated. In addition, CRAN requires compatibility with major operating systems.

### 3.3. Impact

The *dексisensitivity* R package covers different algorithms that are useful for a large number of models. The French agricultural research community used these algorithms to better understand the structure and the results obtained by the models they develop (see [9]). However up to now, access to them was quite confidential and linking the algorithms to the models was not straightforward. This was not suitable and satisfactory, especially when more and more of these models are developed in a participatory manner with different stakeholders. With the *dексisensitivity* R package, we make these algorithms fully accessible and usable with a larger type of model structure. The ease of use of DEXi software and the seamless link with the *dексisensitivity* R package will then allow a straightforward and transparent creation and analysis of the different models.

### 3.4. Conclusion and future development

The *dексisensitivity* R package enables the analysis of models developed using the DEXi software. Given the software's user-friendly nature, it will be accessible to a wide range of users, including those with no prior knowledge of statistics or R.

Two key areas of development are planned for the near future:

1. Advanced Sensitivity Analysis Functions:

To implement more advanced sensitivity analysis functions, similar to those in the sensitivity R package (10.32614/CRAN. package.dexisensitivity), and to extend the current sensitivity methods to accommodate more complex and uncommon DEXi-tree structures.

2. Improved User-Friendliness and Graphical Outputs:

To create a more user-friendly environment by enhancing the generation of synoptic graphs (particularly their formatting) and supporting additional graph formats. Development with RShiny [11] is underway to provide a more intuitive interface for end-users (https://izi-eval.sk8.inrae.fr).

All these enhancements will be integrated into the multicriteria assessment platform Means (https://means.inrae.fr/).

## CRediT authorship contribution statement

**Roland Allart:** Visualization, Methodology, Investigation, Formal analysis, Conceptualization.
**Aude Alaphilippe:** Funding acquisition.
**Marta Carpani:** Formal analysis.
**Nicolas Cavan:** Visualization, Validation.
**Hervé Monod:** Formal analysis.
**Jacques-Eric Bergez:** Writing – review & editing, Writing – original draft, Visualization, Supervision, Methodology, Conceptualization.

## Declaration of competing interest

The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

## Acknowledgments

This action is led by the Ministries for an Ecological Transition, for Agriculture and Food, for Solidarity and Health and of Higher Education, Research and Innovation, with the financial support of the French Office for Biodiversity, as part of the call for research projects "Durability of alternative agricultural production systems, avoiding or limiting the use of phytosanitary products", with the fees for diffuse pollution coming from the Ecophyto II+ plan". We would like to thank R. Faivre, who helped with the Shapley-Shapiro algorithm.

## References

[1] Walid Sadok, F. Angevin, J.E. Bergez, C. Bockstaller, B. Colomb, L. Guichard, R. Reau, A. Messéan, T. Doré, MASC, a qualitative multi-attribute decision model for ex ante assessment of the sustainability of cropping systems, Agron. Sustain. Dev. 29 (2009) 447–461, http://dx.doi.org/10.1051/agro/2009006.

[2] M. Bohanec, B. Zupan, A function-decomposition method for development of hierarchical multi-attribute decision models, Decis. Support Syst. 36 (2004) 215–233, http://dx.doi.org/10.1016/S0167-9236(02)00148-3.

[3] Č. Rozman, M. Potočnik, K. Pažek, A. Borec, D. Majkovič, M. Bohanec, A multicriteria assessment of tourist farm service quality, Tour. Manag. 30 (2009) 629–637, http://dx.doi.org/10.1016/j.tourman.2008.11.008.

[4] M. Žnidaršič, M. Bohanec, B. Zupan, Modelling impacts of cropping systems: Demands and solutions for DEX methodology, European J. Oper. Res. 189 (2008) 594–608, http://dx.doi.org/10.1016/j.ejor.2006.09.093.

[5] Walid Sadok, F. Angevin, J.-E. Bergez, C. Bockstaller, B. Colomb, L. Guichard, R. Reau, A. Messéan, T. Doré, MASC, a qualitative multi-attribute decision model for ex ante assessment of the sustainability of cropping systems, Agron. Sustain. Dev. 29 (2009) 447–461, http://dx.doi.org/10.1051/agro/2009006.

[6] E. Pelzer, G. Fortino, C. Bockstaller, F. Angevin, C. Lamine, C. Moonen, V. Vasileiadis, D. Guérin, L. Guichard, R. Reau, A. Messéan, Assessing innovative cropping systems with DEXiPM, a qualitative multi-criteria assessment tool derived from DEXi, Ecol. Indic. 18 (2012) 171–182, http://dx.doi.org/10.1016/j.ecolind.2011.11.019.

[7] B. Colomb, M. Carof, A. Aveline, J.E. Bergez, Stockless organic farming: Strengths and weaknesses evidenced by a multicriteria sustainability assessment model, Agron. Sustain. Dev. 33 (2013) 593–608, http://dx.doi.org/10.1007/s13593-012-0126-5.

[8] P. Mouron, B. Heijne, A. Naef, J. Strassemeyer, F. Hayer, J. Avilla, A. Alaphilippe, H. Höhn, J. Hernandez, G. Mack, G. Gaillard, J. Solé, B. Sauphanor, A. Patocchi, J. Samietz, E. Bravin, C. Lavigne, M. Bohanec, B. Golla, C. Scheer, U. Aubert, F. Bigler, Sustainability assessment of crop protection systems: Sustainos methodology and its application for apple orchards, Agric. Syst. 113 (2012) 1–15, http://dx.doi.org/10.1016/j.agsy.2012.07.004.

[9] D. Craheix, J.-E. Bergez, F. Angevin, C. Bockstaller, M. Bohanec, B. Colomb, T. Doré, G. Fortino, L. Guichard, E. Pelzer, A. Méssean, R. Reau, W. Sadok, Guidelines to design models assessing agricultural sustainability, based upon feedbacks from the dexi decision support system, Agron. Sustain. Dev. (2015) 35, http://dx.doi.org/10.1007/s13593-015-0315-0.

[10] M. Carpani, J.E. Bergez, H. Monod, Sensitivity analysis of a hierarchical qualitative model for sustainability assessment of cropping systems, Environ. Model. Softw. 27–28 (2012) 15–22, http://dx.doi.org/10.1016/j.envsoft.2011.10.002.

[11] W. Chang, J. Cheng, J. Allaire, C. Sievert, B. Schloerke, Y. Xie, J. Allen, J. McPherson, A. Dipert, B. Borges, shiny: Web application framework for R. R package version 1.10.0, 2024, https://github.com/rstudio/shiny, https://shiny.posit.co/.

## Further reading

[1] W. Sadok, F. Angevin, J. Bergez, C. Bockstaller, B. Colomb, L. Guichard, R. Reau, T. Doré, Ex ante assessment of the sustainability of alternative cropping systems: Implications for using multi-criteria decision-aid methods - A review, Sustain. Agric. (2009) http://dx.doi.org/10.1007/978-90-481-2666-8_46.