wpeterman / ResistanceGA

Optimize resistance surfaces using Genetic Algorithms
36 stars 15 forks source link

Trouble with resistance values #40

Closed martinsc93v closed 11 months ago

martinsc93v commented 1 year ago

Good afternoon, greetings from Argentina. First of all I would like to thank you very much for the creation of this tool that I am using extensively in my doctoral thesis project.

I'been stuck the last few days in the analysis of the resistance surfaces obtained by using the "all.comb" function. I am analyzing 5 categorical rasters layers, taking advantage of this function to analyze the interactions between them. At the end of the "single surface" part of the analysis, I obtain that 3 of them have a resistance value of 1000 and two of 1 (as I can see in the surface obtained with .asc format).

Analyzing this recent work using the package ResistanceGA: https://link.springer.com/article/10.1007/s11252-023-01434-9

I find a table in which resistance values are specified for each variable, but these are not interactions but values for each landscape layer (Table 4).

Is there a way to obtain a resistance surface with values for all the landscape categories analyzed as obtained in this work? I am stuck with values of 1000 and 1 (depending on where the variable is present or not).

Thank you very much for any help

martinsc93v commented 1 year ago

image

This is the categorical results I obtained

wpeterman commented 1 year ago

I'm not exactly sure what you're describing. I think the results you're looking for will be in the combination of all five surfaces. Note, the default of ResistanceGA is to scale resistance surfaces to have a minimum of 1 and maximum of 1,000 (or whatever you specify). Because you only have two levels (habitat present = 1 and habitat absent = 0), the outputs and interpretations are kind of wonky.

martinsc93v commented 1 year ago

Dear Bill, thank you very much for your quick response. I admire your work very much. I have two more questions:

1- When using the function "all.comb", with 5 my surfaces, it does not perform the analysis of the joint surface of the 5 layers, but ends up in the analysis of all the combinations of 4 surfaces. Is there a way to make the surface that includes all of them?

2- When I finish the bootstrap analysis and the summaries of the model with the function "all.comb", I find that the best model to explain my data is the distance model (as expected in my case). Being that a model of 4 or 5 surfaces has a larger AICc than the distance model, does it make sense to consider the resistance values of that joint surface even though it is not the best model?

I hope I have explained myself well and thank you very much for your answer.

wpeterman commented 1 year ago

1- When using the function "all.comb", with 5 my surfaces, it does not perform the analysis of the joint surface of the 5 layers, but ends up in the analysis of all the combinations of 4 surfaces. Is there a way to make the surface that includes all of them?

2- When I finish the bootstrap analysis and the summaries of the model with the function "all.comb", I find that the best model to explain my data is the distance model (as expected in my case). Being that a model of 4 or 5 surfaces has a larger AICc than the distance model, does it make sense to consider the resistance values of that joint surface even though it is not the best model?

jamesryan1896 commented 11 months ago

Hello,

I am curious about this becasue I have also recently updated ResistanceGA and have been optimising using Circuitscape in Julia, and since that occured my binary categorical RS have also been giving me resistance values of 1 and 1000 for my two feature classes (also presence/absence layers). Previously my optimised binary categroical surfaces had been giving me resistances of 1 (as always) and another value which was usually somewhere between 2 and 150 (for example), but each layer ended up with unique values. Is there any reason why now when I perform single surface optimisation that I always get resistances of 1 and 1000 for each of my 9 categorical layers? Is the value unimportant and the real take away is wether the feature is impeding or facilitating gene flow?

Thank you!

wpeterman commented 11 months ago

Thanks for bringing this to my attention. There were adjustments made to the rescaling of categorical resistance values a while back (4.2-4), but this was not the intended result. This issue should be corrected in the latest GitHub version.