dams-mcda / Dams-MCDA

Emma Fox R/Shiny Project with a docker server configuration
1 stars 0 forks source link

East Millinocket strange graph issue #150

Closed elbfox closed 4 years ago

elbfox commented 4 years ago

There is a problem with the East Millinocket graphs in Figs. 1 and 2, where the improve hydro values are lower than they should be and the improve fish passage values are higher than they should be. Using the Equal preferences file (attached but in csv format), my Excel file (also attached) checks out for all other graphs. EqualPrefs_forLiveSite.xlsx MCDA_Check_CalcsGraphsEQUAL092519 (2).xlsx Live app multi-dam results: image Excel multi-dam results (individual dams calculated from DamsData.csv and equal prefs file above, not the 995 scenario dataset): image

The strange thing is that the Weighted Scores are consistent across the app and the Excel File.

image image

So, I think the problem is in whatever fix you are trying to do in the graph. I think we only need this "rules" catch for the multi-dam part. It appears to be layering on top of the fix I added back in the NormalizationChanges branch (WSM.R):

    Ind_NormalizedMatrix[2:5,6,3] <- c(1,1,1,1)#This replaces properties NaN at East Millinocket
    Ind_NormalizedMatrix[1,1,2] <- 1 #This replaces fish habitat NaN at Medway
    Ind_NormalizedMatrix[5,3,1:3] <- 1#This replaces the reservoir storage NaN at West Enfield, Medway, East Millinocket
    Ind_NormalizedMatrix[1,2,7] <- 1 #This replaces the river rec NaN at Millinocket Lake
elbfox commented 4 years ago

Sharon pointed out this also appears to be happening for Ripogenus. The value is slightly off for improve fish passage as well (58 vs 60). I haven't checked the WeightedResults yet to see for sure if the problem is the same.

sythel commented 4 years ago

The strange thing is that the Weighted Scores are consistent across the app and the Excel File

seems like numProperties is not consistent

sythel commented 4 years ago

and its normalized value in figure table 11 is 0 for numProperties

sythel commented 4 years ago

@elbfox server.R is using f_nrge2 but it seems f_nrge maybe was updated more recently, which should we use?

elbfox commented 4 years ago

@elbfox server.R is using f_nrge2 but it seems f_nrge maybe was updated more recently, which should we use?

It doesn't matter at this point because Sam will be updating on Monday after he runs the MOGA. Use f_nrge if you want the more updated.

sythel commented 4 years ago

Table 10. numProperties is 0 as well. maybe DamsData is the issue?

Properties always 0 in DamsData

elbfox commented 4 years ago

No, it's the normalization again because the data values are 0 for all num properties. This should fix numProperties for East Millinocket.

    Ind_NormalizedMatrix[2:5,6,3] <- c(1,1,1,1)#This replaces properties NaN at East Millinocket
    Ind_NormalizedMatrix[1,1,2] <- 1 #This replaces fish habitat NaN at Medway
    Ind_NormalizedMatrix[5,3,1:3] <- 1#This replaces the reservoir storage NaN at West Enfield, Medway, East Millinocket
    Ind_NormalizedMatrix[1,2,7] <- 1 

Is your 'rules' catch happening for these individual dams? It shouldn't be. I think we have to be weirdly specific here in the normalization, so I'm not sure there is anything better than a static fix at this point.

sythel commented 4 years ago

@elbfox yes that fix does get E.Milli to the values matching to the excel graphic

elbfox commented 4 years ago

Good. Thanks for checking. @sythel can you just confirm for me that you've taken the 'rules' part out for graphs for individual dam results?

sythel commented 4 years ago

I have not yet; rules are only applied to specifically to Figure 2. Figure 3. will remove them if you still request

they don't manipulate values, just for choosing top alternative when multiple alts have same sum

elbfox commented 4 years ago

I'm confused, I thought they were for addressing the normalization weirdness (because some of the dams have 0 values for all decision alternatives) for the multi-dam dataset?

sythel commented 4 years ago

nope, just for cases when theres multiple max alternatives. conversation takes place in #81 quoted below

@sythel Member graph2 cases where multiple alternatives are same value. Is there some preference which alternative is selected? (ie: removeDam takes higher priority than Improve Hydro) @elbfox Member Author elbfox commented 8 days ago It depends on the criteria, unfortunately. So, with reservoir storage it's keep and maintain dam, and with fish habitat it's remove dam. With number of properties it's any option besides remove dam, so keep and maintain is good if you need a top priority. @sythel Member sythel commented 8 days ago • are those the only constraints rules? or does each criteria? list them all if possible/applicable

sythel commented 4 years ago

Sharon pointed out this also appears to be happening for Ripogenus. The value is slightly off for improve fish passage as well (58 vs 60). I haven't checked the WeightedResults yet to see for sure if the problem is the same.

ripos value change is probably from rounding; compared from Table 32 and your excel sheet tab(Weighted_Norm_DamsData)

sythel commented 4 years ago

issue possibly closed?

elbfox commented 4 years ago

Thanks for clarifying. I definitely thought you were doing something different! It all makes sense now.

I think we can close this issue.