Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Copras method due to erroring #359

Merged
merged 6 commits into from
May 26, 2023
Merged

Remove Copras method due to erroring #359

merged 6 commits into from
May 26, 2023

Conversation

Rosejoycrocker
Copy link
Collaborator

@Rosejoycrocker Rosejoycrocker commented May 25, 2023

Closes #357

Copras method was causing issues due to giving all NaNs for the criteria scores, so that rankings were meaningless. On further research it seems the Copras method is a weighted linear combination of the score for criteria to be maximised divided by the maximum criteria score and score for criteria to be minimised divided by minimum criteria score. It seems that maybe because ADRIA only has maximising criteria this was giving NaN scores (all other methods were found to not error with the same decision matrix and the error occured for any decision matrix with the Copras method). To fix this issue, Copras is removed from the available set of methods in this PR.

All other methods were tested for their outputs to verify that they should not error (given reasonable decision matrix and weightings) and compared to the JMcDM docs.

- Copras should be equivalent to Topsis when only maximisation is involved (of criteria)
- This is probably what caused it to error (possibly min value is set as 0 because no criteria are minimised and then score is divided by this, giving NaNs).
@Rosejoycrocker Rosejoycrocker added the bug Something isn't working label May 25, 2023
@Rosejoycrocker
Copy link
Collaborator Author

Tests all passing on my end

@@ -45,7 +45,7 @@ Base.@kwdef struct Intervention{N,P,P2} <: EcoModel
# Integer values have a +1 offset to allow for discrete value mapping
# (see `set()` and `map_to_discrete()` methods)
# Bounds are defined as floats to maintain type stability
guided::N = Param(0, ptype="integer", bounds=(-1.0, 21.0 + 1.0), dists="unif",
guided::N = Param(0, ptype="integer", bounds=(-1.0, length(methods_mcda) + 1.0), dists="unif",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the const number of available methods instead to avoid repeated editing

JMcDM.MEREC.MERECMethod,
JMcDM.ELECTRE.ElectreMethod,
JMcDM.PROMETHEE.PrometheeMethod,
JMcDM.Topsis.TopsisMethod,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rose, I've removed TOPSIS and VIKOR from consideration, but did you intend to keep these in for a reason I wasn't aware of?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That probably makes sense to avoid overlap. I kept them in incase we wanted a "fast version" because they are quite a bit faster than the JMcDM implementations, but it's not very noticable when running a lot of simulations.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not very noticable when running a lot of simulations.

That's when it should be very noticeable? I'm noting roughly an extra minute in run times compared to when we were only considering the three methods for 1024 scenarios.

I'll do a more in-depth profiling, but noting that seemingly small increases has a large implication for scenario/sensitivity analysis.

Copy link
Collaborator

@ConnectedSystems ConnectedSystems left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rosejoycrocker some minor comments for your review. If all okay then I will merge.

Confirm tests pass here too.

@Rosejoycrocker
Copy link
Collaborator Author

All good on my end :)

@ConnectedSystems ConnectedSystems merged commit 0be28ac into main May 26, 2023
@ConnectedSystems ConnectedSystems deleted the JMcDM-error branch May 26, 2023 07:27
@ConnectedSystems
Copy link
Collaborator

image

FYI, PSIMethod looks promising, at least for coral cover (14th in the methods list).

@Rosejoycrocker
Copy link
Collaborator Author

Oh cool, PSI is based on approximate pareto optimal solutions in the criteria space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MCDA method errors
2 participants