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.– Delonix R.2016年04月22日 20:15:16 +00:00Commented Apr 22, 2016 at 20:15
-
Use float(1) and float (1)FelixIP– FelixIP2016年04月22日 20:21:04 +00:00Commented Apr 22, 2016 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– whuber2016年04月23日 00:51:55 +00:00Commented Apr 23, 2016 at 0:51
-
yeah ive tried playing with symbology, but there are no values other than zero to display.sam– sam2016年04月25日 16:20:30 +00:00Commented Apr 25, 2016 at 16:20
1 Answer 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.
-
Sam's formula is the correct one for what he wants it to do. See en.wikipedia.org/wiki/Logit.whuber– whuber2016年04月23日 00:54:32 +00:00Commented Apr 23, 2016 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– sam2016年04月23日 02:36:15 +00:00Commented Apr 23, 2016 at 2:36
Explore related questions
See similar questions with these tags.