psenovsky / MCDASupport

GNU General Public License v3.0
0 stars 0 forks source link

MCDASupport R Package

MCDASupport R package aims to give the educators tool in their hands to both demonstrate the usage of modern multiple criteria decision analysis and explore inner working of them, its quirks and limitations in the code and mathematical apparatus in accompanying documentation. Apart from MCDA methods it supports also various normalization methods and EWM method for criteria weight estimation.

Description

implemented MCDA methods:

TOPSIS, SIR and VIKOR are implemented for normal and fuzzy numbers.

For normalization package supports:

For weight establishment the package supports EWM (Entropy Weight Method).

The package has also some graphical capabilities to help visualizing network of outranking relations between the alternatives and tools to visualize changes in ranking due to changes in analysis parameters (sensitivity analysis).

Sensitivity analysis at present time is in its infancy. Package has quick and dirty implementation for sensitivity testing, but it seems that current implementation has no potential to actually induce rank changes. More robust implementation of the analysis will be required for that.

At present time the package is officially available only from this repository and not from CRAN as is usual for this type of packages. The reason is that the package IMHO doesn't meet quality criteria to be on CRAN. Main problems and limitations are:

For educational purposes these limitations are not that significant, but for analytic purposes these are rather severe. In short - no CRAN in near future.

Getting Started

Dependencies

The "binary" version of the package is provided for last stable version of R (4.3, https://www.r-project.org), but since the the package is fully implemented in R, you should be able to make it work on older versions of R, provided the other required packages are successfully installed first, see installation process for details.

R packages MCDASupport depends on:

Installing

You can use following R code to install package and its dependencies

# check for missing dependencies
packages <- c("mathjaxr", "graphics", "igraph", "diagram", "stats", "dplyr", "visNetwork", "plotly", "tidyr")
install.packages(setdiff(packages, rownames(installed.packages())))  
# adjust name of the file to version you are installing
install.packages("MCDASupport_0.29.tar.gz", repos=NULL, type="source")  

Executing program

Installed package needs to be activated in development environment of your choice, typically RStudio: https://posit.co/download/rstudio-desktop/, via GUI or in code:

library(MCDASupport)

Example usage of ELECTRE IV method:

# specify decision problem
# start with performance matrix
# alternatives are in the rows, criteria in columns
PM <- cbind(
  c(-14,129,-10,44,-14),
  c(90,100,50,90,100),
  c(0,0,0,0,0),
  c(40,0,10,5,20),
  c(100,0,100,20,40)
)
rownames(PM) <- c("Project1","Project2","Project3","Project4","Project5") # alternatives
colnames(PM) <- c( "CR1","CR2","CR3","CR4","CR5") # criteria
minmaxcriteria <- 'max' # all decision criteria are "benefical"
Q <- c(25,16,0,12,10) # Indifference thresholds
P <- c(50,24,1,24,20) # Preference thresholds
V <- c(100,60,2,48,90) # Veto thresholds
# compute the problem using the method of choice
result <- Electre_4(PM, P, Q, V, minmaxcriteria)
result$graph # outranking in graphical form
result$final_ranking # final ranking of alternatives

See package's built-in documentation for further detail on available functions, its required parameters and provided outputs and its mathematical apparatus.

Help

TBD

Authors

The project started as a fork of Outranking Tools package by M. Prombo. Original package is no longer maintained (since 2014) and is available only from CRAN archives at https://cran.r-project.org/src/contrib/Archive/OutrankingTools/.

Outranking tools had implementations of Electre I - III methods, which have been reimplemented in MCDASupport using Prombo's code with some updates. These updates, as well as all other methods been implemented by Pavel Šenovský (pavel.senovsky@vsb.cz). Who is also current the maintainer of the package.

See function's documentation for information on mathematics and theories methods in this package has been based on.

Version History

MCDASupport v0.30 (Release date: 2024-06-17)

The main topic of version 0.30 is to further optimize the code and also make it more readable. As result there are changes in almast all functions.

MCDASupport v0.29 (Release date: 2023-12-19)

Main goal of version 0.29 is to go back to basics and look at the efficiency of the inner working of the functions. Since original implementation was inspired by classical programming languages, the functions relied extensively on the cycles to realize the computation. But R is optimized to different types of computations and provides alternative approaches to get same results but with highly efficient work with matrices instead.

Such efficiency is desirable as it will speed computation especially for more advanced sensitivity analyses, which should be implemented in the future. It slould also improves readability of the code by significantly simplifying it.

The optimizations have been applied to:

other changes:

Full version history

For full version history see [[NEWS]].md file.

License

MCDASupport R package is a library with various functions for computations around multiple criteria analyses

Copyright (C) 2024 by Pavel Šenovský

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program (see [[LICENSE]] ). If not, see http://www.gnu.org/licenses/.