Open clint-leach opened 6 years ago
How would this interact with the Dirichlet Process prior?
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.
Other possible issues:
j
has only prey i
, and that prey has no other predators, then there's no information on the position of c_j
and n_i
, other than that they should be close together.[0, 1]
and fit just as well. 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.
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.
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?
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).
In Williams et al. 2010, they fix
r
andc
to small values for primary producers. These parameters aren't really meaningful for primary producers and there's nothing to informc
, as long asr
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 withr
getting shrunk arbitrarily small, but the prior might be able to prevent that.