eco-detectives / eco_detective

Reading/coding group for The Ecological Detective
1 stars 3 forks source link

Chapter 7: done... ugggghhhhh #12

Open oharac opened 6 years ago

oharac commented 6 years ago

finished the unending chapter. I struggled to figure out how to approach 7.7, and not at all sure I got it "correct" though I got something that resembled the basic concepts.

Where I struggled:

So far so good I think?

Here our parameters are r, p, q, to calculate an index of abundance, basically the expected number of observed individuals Iobs for an actual population D. So the deterministic index Idet = max[0, (p + qD)/(1 + rD)].

So here's the problem: even if we set p = -3 and r = 0.03, and let q vary around 1, different values of q*D will result in different numbers of NAs. Same if we let p and r vary, but the first case is easier.

Anyway, I got something that vaguely resembled Figure 7.9, but only vaguely. So maybe I'm making some unfounded assumption that f's it all up? Let me know what you think when you get to pseudocode 7.7...

Cheers

oharac commented 6 years ago

an option to avoid this problem entirely is to ignore p = -3, and just set p >= 0 (and then your testing range over p for 7.7B should stay in the positive range too). The plots look better!

image