Comments (4)
Yes, that's been requested before. I am very open for pull requests!
from ahp.
Hi,
The shinny AHP app is a very good tool for solving AHP Problems. It would be also great if we can add sensitivity analysis on the results which can make this package a complete suite for decision making.
from ahp.
Prototyping some ideas here. These manipulate the trees differently from the rest of package code, and they could be nonsense, so it is not contribution-ready.
# Brainstorming some sensitivity charts
library(dplyr)
library(magrittr)
library(tidyr)
library(ggplot2)
library(ahp)
# reuse the car example
ahpFile <- system.file("extdata","car.ahp",package="ahp")
carAhp <- Load(ahpFile)
Calculate(carAhp)
# variant a
# the Hurley method scales the preferences by some coefficient
# priorities obtained from scaled pairwise weights
coefficient_range <- seq(0.1,2.0,0.1)
original <- carAhp$preferences$children$DecisionMaker$pairwiseMatrix$preferences
df <- bind_rows(sapply(coefficient_range, function(j) {
weights <- original ^ j
priorities <- PrioritiesFromPairwiseMatrixEigenvalues(weights)
data.frame(Coefficient=j,t(priorities$priority))
},simplify=FALSE))
# reorganize for plotting
tdf <- df %>% gather(Preference,Weight,-Coefficient)
p <- ggplot(tdf,aes(x=Coefficient,y=Weight,color=Preference)) +
geom_line() +
scale_y_continuous(limits=c(0,1)) +
geom_vline(xintercept=1.0,linetype="dashed") +
labs(title = "Priorities from Pairwise Matrix Eigenvalues",
caption = "Hurley-method sensitivity analysis",
x=expression(paste("Coefficient ",alpha)))
p
# variant b
# manipulating the decision-maker preferences
# scaled coefficient range reused
# not strictly a Hurley variant because it can result in rank reversal
# reload the model
carAhp <- Load(ahpFile)
Calculate(carAhp)
original <- carAhp$preferences$DecisionMaker$pairwise$preferences$preference
df <- bind_rows(sapply(coefficient_range, function(j) {
scaled <- original ^ j
carAhp$preferences$DecisionMaker$pairwise$preferences$preference <- scaled
Calculate(carAhp)
adf <- Analyze(carAhp,decisionMaker="Total",variable="weightContribution",sort="orig")
adf %<>% select(-1,-Weight)
if ( "Inconsistency" %in% colnames((adf)))
adf %<>% select(-Inconsistency)
data.frame(Coefficient=j,adf[1,])
},simplify=FALSE))
# reorganize for plotting
tdf <- df %>% gather(Priority,Weight,-Coefficient)
p <- ggplot(tdf,aes(x=Coefficient,y=Weight,color=Priority)) +
geom_line() +
geom_vline(xintercept=1.0,linetype="dashed") +
labs(title = "Priority by Scaled Pairwise Preferences",
y="Weight Contribution",
x=expression(paste("Coefficient ",alpha)))
p
from ahp.
Hello,
Is there any development on sensitivity to this package? I would like to see if there is any.
Thanks
from ahp.
Related Issues (20)
- Add Consistency Checks to All Priority Calculation Methods HOT 3
- Add Ideal Mode AHP Option HOT 5
- problem in calculate ahp file HOT 1
- How can I resolve a problem with more than 8 alternatives? HOT 1
- Actually loading file from a working directory HOT 3
- Build the AHP file from the result of a survey HOT 3
- Cannot load AHP file HOT 1
- how to support utf-8 character in yaml file? HOT 3
- How to handle "car.ahp" file? HOT 1
- Windows HOT 1
- Problems with YAML
- Why does the online yaml visualizer not work? HOT 1
- node$field will soon deprecate and therefore Visualize() needs update
- loadFile HOT 2
- Priorities derivation difference with Saaty's publication HOT 4
- Visualize does not complete HOT 2
- Load() is not reading pairwise HOT 4
- Is it possible to have a hierarchy of alternatives besides a criteria hierarchy? HOT 1
- problem in writing ahp HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ahp.