You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new provider with capacity equal to required capacity (unsatisfied demand)
The increase in coverage should be equal to population under coverage but it is not
The best workaround to fix this was 00cacf7
by giving more precision to the calculation the difference reduces dramatically. But the difference is still there.
Why is this happening? Because population under coverage and increasement in coverage are calculated in different ways, which can be affected by numerical rounding errors.
Population under coverage is measured as population under coverage (from all changed providers) from the baseline demand raster.
Increasement in coverage is measured as the difference between the initial unsatisfied demand for the whole region, and the unsatisfied demand of the scenario after accounting for the changes.
The values being accumulated in both cases are orders of magnitude lower than the totals, and there is a large number of pixels. Depending on the order in which the pixel values are accumulated, this can lead to a sizeable numerical error depending on the precision of the operands and the difference between them (eg. number of significant digits of the mantissa vs. differences in the exponents). Raster pixels are always 32-bit floats.
And there is also a difference between the number of pixels involved in each computation: the population under coverage by definition is calculated from a smaller (sometimes a lot smaller) number of pixels than the unsatisfied demand for the whole region.
A better possible solution for this would be measuring the increasement in coverage only for the population under coverage. This requires loading the initial scenario unsatisfied demand raster into memory in addition to the other two needed now: the base demand raster and the current scenario demand (which is being computed). (NB: initial unsatisfied demand and base demand are not the same, as the scenario might have initial providers)
The text was updated successfully, but these errors were encountered:
Steps to reproduce:
The best workaround to fix this was 00cacf7
by giving more precision to the calculation the difference reduces dramatically. But the difference is still there.
Why is this happening? Because population under coverage and increasement in coverage are calculated in different ways, which can be affected by numerical rounding errors.
The values being accumulated in both cases are orders of magnitude lower than the totals, and there is a large number of pixels. Depending on the order in which the pixel values are accumulated, this can lead to a sizeable numerical error depending on the precision of the operands and the difference between them (eg. number of significant digits of the mantissa vs. differences in the exponents). Raster pixels are always 32-bit floats.
And there is also a difference between the number of pixels involved in each computation: the population under coverage by definition is calculated from a smaller (sometimes a lot smaller) number of pixels than the unsatisfied demand for the whole region.
A better possible solution for this would be measuring the increasement in coverage only for the population under coverage. This requires loading the initial scenario unsatisfied demand raster into memory in addition to the other two needed now: the base demand raster and the current scenario demand (which is being computed). (NB: initial unsatisfied demand and base demand are not the same, as the scenario might have initial providers)
The text was updated successfully, but these errors were encountered: