Why does my raster calculator output give a black raster after using Exp?

1386
1
10-09-2017 03:16 PM
Farah_Tasneem
New Contributor

Hello everyone,

I am trying to add multiple raster layers and multiply them by the coefficients of the equation derived by logistic regression. However, when I do add the rasters, I just get a black raster with 0 pixel values. How can I get a raster with 0 to 1 values?

I am attaching a snapshot of the max and min values of my rasters and also the logistic regression equation. I have tried breaking down the equation and only performing the portion inside the Exp and that seemed to look reasonable but using the Exp function is what causes problems. (By the way, I have changed the raster names properly in raster calculator so this isn't an issue).

Logistic regression equation:

1 / (1 + Exp( - (11.97 - 0.000038 * "pop_centres" - 1.6 * "NDVI_2013" - 0.0053 * "Dem30v3proj" - 0.19 * "Slope30v3" - 0.000015  * "Camps30" - 0.032 * "June_prec" - 3.47 * "june_vappres" -  0.000127  * "EUC_2013")))

Screenshot of some of the explanatory layers

0 Kudos
1 Reply
DanPatterson_Retired
MVP Emeritus

You will have to validate your inputs, since I suspect that you are violating one of the conditions.

Exp help topic.... 

  • Input values can be integer or float, and can be negative as well as positive. You can review some results for both positive and negative floating-point input values in the examples of output values from the Exponential tools.
  • The base e exponential is the most commonly used exponential function.
  • Input values less than or equal to -745 will be set to NoData in the output, because these values cannot be accurately represented by 32-bit floating-point numbers.
  • The output raster from this tool is always floating-point type, regardless of the input value type. Output values from this tool are always positive.

See this as well.......

So to confirm your assertion that the portions look fine, you will have to present the values for the various pieces of the equation as separate arrays summaries to confirm that you aren't going below the threshold, or experiencing other forms of numeric underflow/overflow for the grid type.  

You might also try to use another raster type, one that supports more than 32bit.