Hello. I am running my own HRAs within R (rather than using the InVEST tool). However, as a first step, I am repeating some very simple analyses in both R and the InVEST tool to make sure that these generate comparable outputs (to verify that my R code is successfully replicating the InVEST HRA). In going through this process, I’m getting risk estimates from the InVEST HRA tool that don’t make sense.
First, I have a 200 x 100 grid. In R, I just work with this grid directly. There is a single habitat and a single stressor, so each grid cell i has a habitat score (1,2,3) and a stressor score (1,2,3). There is one additional exposure criterion and one additional consequence criterion (these additional criteria are not spatially explicit), which are both fixed with values of 2. Data quality (DQ) and weights are also fixed at 2 for all criteria. There is no distance decay function or buffer.
I am using the Euclidean risk function:
R.i = sqrt( (E.i-1)^2 + (C.i-1)^2) )
where
E.i = sum( e.i/(de.i * we.i) ) / sum(1/(de.iwe.i)), where de.i and we.i are DQ and weights for the e.i
C.i = sum( c.i/(dc.i * wc.i) ) / sum(1/(dc.iwci)), where dc.i and wc.i are DQ and weights for the c.i
So, in my specific test case, the calculation of E and C for cell i are based one one spatially-explicit Exposure (or Consequence) value that can have a value 1,2,3, and one spatially non-explicit Exposure (or Consequence) value that has a value of 2. Again, W and DQ are all 2. Thus, the max value for E.i is:
E.i = (3/(22) + 2/(22)) / ((1/22) + 1/(22)) = 5/4 / 2/4 = 5/2 = 2.5
And the max value for C.i is similarly 2.5
Thus, the max value for any R.i should be sqrt( (2.5-1)^2 + (2.5-1)^2 ) = 2.12, assuming there are some cells where the spatially-explicit e.i and c.i both have the max of 3 (and there are many such cells).
But, when I run this through the InVEST HRA, the output (summary_statistics.csv) correctly says that the max E and max C are both 2.5, but then also says that the “R_MAX” is 2.25, which should be impossible.
FYI, for running this through the InVEST tool, the 200x100 grids (for habitat and stressor) were converted into polygon layers, projected near the equator, so that each cell is approximately 2770m on a side. Then at the InVEST GUI, the resolution is specified as 2770m. The max criteria score is specified as 3. Risk equation = Euclidean. Decay function = NONE. For the criteria scores, I’m specifying the spatially explicit species/habitat layer as a Consequence (C) criteria within the “Habitat Resilience” table. Within the “Habitat Stressor Overlap Properties” table, I’m specifiying the other non-spatial C criteria and the two E criteria (one being non-spatial, and the other being the spatially-explicit stressor layer)
Questions:
-
I’m seeking explanation for how the InVEST tool can calculate a Risk.i value of 2.25, given max E.i and C.i values of 2.5.
-
I’m also seeking clarification on the importance of listing different E and C criteria within different portions of the criteria table. Based on the formulae described in the manual, it shouldn’t matter where I list the different criteria. But I seem to get different results depending on which part of the table I include the criteria, irrespective of whether I label them E or C. For example, are all criteria listed under the “Habitat Resilience Attributes” treated as Consequence criteria, irrespective of whether they are input as E or C? The documention sort of suggests this in describing how the criteria table .csv should be set up, but it’s not entirely clear.
-
How are “subregions” defined and outputs obtained for these?
Thank you!
Jeff