3

Working in ArcMap, I am trying to convert the logit values in raster into their actual probabilities (logistic regression,) using the following function:

1/(1+Exp(-"sn_topo_poly_log"))

Ive used this function before and it should return a raster with values from 0 to 1. Instead I get a raster with all values=0.

the input raster "sn_topo_poly_log," looks correct and has values from close to zero to -871361

  • Have you try to work with 1 as 1.0, at least in the first one (in both woulnd't hurt)? – Delonix R. Apr 22 '16 at 20:15
  • Use float(1) and float (1) – FelixIP Apr 22 '16 at 20:21
  • 1
    @Nir That's simply incorrect. Sam: Could you explain how you know all the values are zero? Sometimes ArcMap's automatic legend is screwed up but the values in the dataset are still ok. – whuber Apr 23 '16 at 0:51
  • yeah ive tried playing with symbology, but there are no values other than zero to display. – sam Apr 25 '16 at 16:20
1

Did you mean to use the equivalent of Python's log1p instead? (So the inverse function)? I think in Arcgis this is the Ln() function

e to the power of 871361.0 is a very large number, and too big to fit in 32bit float, so arc will convert it to nodata. The same thing happens for negative values less than -745, which are too small to represent in a float.

If I do math.log1p(871361.0) I get a value around 13.67 - so e^13.67 is around 871361.

My math is a bit rusty, so apologies if you did mean to use exp() - you'll just need to normalise your data to fit into a smaller range of values.

| improve this answer | |
  • Sam's formula is the correct one for what he wants it to do. See en.wikipedia.org/wiki/Logit. – whuber Apr 23 '16 at 0:54
  • yes ive double checked and I'm fairly certain the function is correct . . . and the output should be between 0 and 1 so i dont think they are too large. any ideas as to why raster calculator would return 0s or even where to look to find out what might be going on? – sam Apr 23 '16 at 2:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.