R the component estimation issue

I can't figure out how to get the components to add up to the actual expected count

Changing the names so they make sense…

library(sp)
library(raster)
## raster 2.0-12 (1-September-2012)
setwd("C:\\Users\\mmann1123\\Desktop\\CrapFolder")
load("example2.RData")

count4_all_mean_public_land_actual = current_mn_resppA  # all variables held at mean, public land actual values
count4_all_mean_public_land_zero = current_mn_respp0  # all variables held at mean, public land all zero
count4_human_mean_public_land_zero = current_resp_fire_np0  # human at mean, public land all zerp
count4_natural_mean_public_land_zero = current_resp_fire_hp0  # natural at mean, public land all zerp
regular_model_expected_fire_count = current_resp_fire  # regular model output

Start with the “grey” plot count4_all_mean_public_land_zero

plot(count4_all_mean_public_land_zero, main = "count4_all_mean_public_land_zero")

plot of chunk unnamed-chunk-2

Calculate the individual effects and sum them

pub_effect = (count4_all_mean_public_land_actual - count4_all_mean_public_land_zero)
plot(pub_effect, main = "public land effect")

plot of chunk unnamed-chunk-4

nat_effect = (count4_human_mean_public_land_zero - count4_all_mean_public_land_zero)
plot(nat_effect, main = "natural effect")

plot of chunk unnamed-chunk-6

hum_effect = (count4_natural_mean_public_land_zero - count4_all_mean_public_land_zero)
plot(hum_effect, main = "human effect")

plot of chunk unnamed-chunk-8

Rather than:

windows()
plot(regular_model_expected_fire_count, main = "expected number")

plot of chunk unnamed-chunk-9

Gives:

plot((hum_effect + nat_effect + pub_effect + count4_all_mean_public_land_zero), 
    main = "sum of human + natural + public land + count4_all_mean_public_land_zero")

plot of chunk unnamed-chunk-10

Alternatively:

plot((hum_effect + nat_effect + pub_effect), main = "sum of human + natural + public land ")

plot of chunk unnamed-chunk-11