bioXgeo / geodiv

Other
11 stars 2 forks source link

Spk and Svk is implemented correctly? #15

Open Cepheidenx opened 5 months ago

Cepheidenx commented 5 months ago

Hi,

i think, the documentation and calcuation of spk (Reduced Peak Height) and svk (Reduced Valley Depth) in geodiv differs from reverence ("See Figure 2a from Kedron et al. (2018) for more details") and its original reference.

geodiv currently calculates the values based on the distribution. for example, spk = abs((1 - stats::quantile(f, probs = 0)) - (1 - stats::quantile(f, probs = smr1)))[[1]]

This is the distance between max. peak height (sp or as geodiv calles it sph) and the highest intersection point of the least mean square line fit to the flattest 40% of the bearing area curve. But in Kendo et. al is using the height of upper left triangle in Abbott curve. The area of this triangle is the same as the area between the horizontal line and the bearing area ratio curve (cf. ref. 2)

This difference can be seen in the original image, where the absolut Spk level is different from Sp http://www.imagemet.com/WebHelp6/Content/Images/BearingCurveSvk.png

Can you please check this?

references:

  1. Kedron, P.J., Frazier, A.E., Ovando-Montejo, G.A. et al. Surface metrics for landscape ecology: a comparison of landscape models across ecoregions and scales. Landscape Ecol 33, 1489–1504 (2018). https://doi.org/10.1007/s10980-018-0685-1
  2. Image Metrology (2017) User’s guide. http://www.imagemet.com/WebHelp6/Default.htm. Accessed 7 Feb 2017
AnnieCooper commented 5 months ago

Thank you for bringing this to my attention! I'm going to work on updates in the next couple of weeks and will update you when it's fixed.

Cepheidenx commented 5 months ago

Thanks Annie, can you also check if its correct to use yval <- (1 - environment(f)$x) .. even_y <- (1 - stats::quantile(f, probs = even_x)) in find_flat? This seems to be the reason why i observe an additional shift by 1 if using geodiv to calculate the bearing area parameters and plot it with the original data. I fear this is done more than once in the code. At least in calculations for Smr1 and Smr2 this is also included.

Thanks for maintaining the package!