clint-leach / niche-model

Bayesian hierarchical probabilistic niche model
MIT License
0 stars 0 forks source link

Fixing parameters? #2

Open clint-leach opened 6 years ago

clint-leach commented 6 years ago

In Williams et al. 2010, they fix r and c to small values for primary producers. These parameters aren't really meaningful for primary producers and there's nothing to inform c, as long as r gets small enough that the range doesn't contain anything.

In that paper, they also fix r to a small value for specialists with only one prey. Not fixing it could cause numerical problems with r getting shrunk arbitrarily small, but the prior might be able to prevent that.

clint-leach commented 6 years ago

How would this interact with the Dirichlet Process prior?

clint-leach commented 6 years ago

In 1fbe406d118f8fbddf208d662b74c37014a324ff, sort the food web by number of prey so that we can drop r and c for basal species and skip over them when looping over predators.

clint-leach commented 6 years ago

Other possible issues:

clint-leach commented 6 years ago

For the first case in the previous comment, there's really nothing to be learned by estimating c_j and n_i, as these don't inform any other links. As a result, it might be best to just prune any such prey from the food web.

More generally, any prey that have only specialized predators (i.e. each predator of a given species preys on only that species), will suffer from the same pathology and should possibly be removed.

clint-leach commented 6 years ago

Code in 9db19257725ce2b21be94f5fe507fe79a13a26c0 removes the prey of specialized predators. Note that this turns those specialized predators into basal species, so we need to keep that in mind if we want to talk about trophic level later.

clint-leach commented 6 years ago

If we're going to apply the above policy of removing the prey of specialized predators, we need to implement it recursively, until there are none left (since removing a prey species could yield its predator, now a basal species, the prey of only specialized predators). Do we really want to carry this that far? Does enforcing hierarchy (i.e. c_j < n_j) give us any help here?

clint-leach commented 6 years ago

We can another problematic case: predators with no predators. n_i is essentially a vulnerability parameter, so if a species has no predators, there's nothing to inform n_i, except potentially c_i if hierarchical constraints are enforced (but even that just sets a lower threshold).