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

WKT
2,1911 gold badge12 silver badges19 bronze badges
asked Apr 22, 2016 at 20:08
4
  • Have you try to work with 1 as 1.0, at least in the first one (in both woulnd't hurt)? Commented Apr 22, 2016 at 20:15
  • Use float(1) and float (1) Commented 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. Commented Apr 23, 2016 at 0:51
  • yeah ive tried playing with symbology, but there are no values other than zero to display. Commented Apr 25, 2016 at 16:20

1 Answer 1

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.

answered Apr 22, 2016 at 20:52
2
  • Sam's formula is the correct one for what he wants it to do. See en.wikipedia.org/wiki/Logit. Commented 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? Commented Apr 23, 2016 at 2:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.