Phylogenetic signal lambda calculation for zero-inflated negative binomial distribution

Hi everyone. I am currently doing some brms for phylogenetic signal estimation and I am using the zero-inflated binomial distribution. As Bürkner explains in “Estimating Phylogenetic Multilevel Models with brms” it can be calculated using the formula “sd_Phylo__Intercept^2 / (sd_Phylo__Intercept^2 + sd_Species__Intercept^2)”, in my case I have Species variation too. However I do not know if for zero-inflated I should add the zi in the formula like this “sd_Phylo__Intercept^2 / (sd_Phylo__Intercept^2 + sd_Species__Intercept^2 + zi^2)”. If someone knows, could you please check and confirm if this approach is correct.

Can you show us your literal model formula as passed to brms?

Ultimately the question here is going to boil down to: do you want to know what proportion of the species-level variance in the discrete (zero-inflated binomial) response is phylogenetically structured, or do you want to know what proportion of the variance in the continuous binomial proportion is phylogenetically structured. This is a scientific question, not a statistical one.

Hi, thank you for replaying. This is the formula that I used:

brm_hum_binom <- brm(
  formula = Humans | trials(N_total) ~ Habitat_N + (1 | gr(Phylo, cov = A_hum)) + (1|Species),
  data = PerHumans,
  data2 = list(A_hum = A_hum),
  family = zero_inflated_binomial(link = "logit"),
  cores = 4,
  chains = 4,
  iter = 4000,
  warmup = 2000,
  control = list(adapt_delta = 0.99,
  max_treedepth = 15))

As I am new to modeling, I want to know if the proportion of blood meals per host from mosquitoes is phylogenetically structured. Therefore, I believe my specific question is: ‘what proportion of the species-level variance in the discrete (zero-inflated binomial) response is phylogenetically structured?

Thank you in advance for the help.

EDIT by Aki: switched the code use code block backtics for improved readability

Note: this post was written by dictating some notes to an AI (Claude) and having it summarize them back for me, then re-editing the output to add some of my voice back in. I don’t like to use AI in my writing, but I didn’t have time to properly draft an answer and figured this is better than letting this thread sit and potentially languish.

I recommend separating the question of phylogenetic structure into two pieces: the binomial part of the model and the zero-inflation part. They should not be combined into a single number. I also recommend that you don’t include the discrete binomial sampling variance in the denominator for computing the phylogenetic signal.

Don’t include the binomial sampling variance in the denominator for how much variance is phylogenetically structured
The count data (as opposed to the underlying proportion) contains an unavoidable amount of “noise” that comes purely from binomial sampling. For a binomial distribution, the variance is completely determined by the mean and the number of trials — for example, flipping a fair coin 10 times gives a variance in the number of heads of exactly 2.5, no matter what. This sampling variance can never be explained by covariates or phylogeny, so it needs to be set aside rather than folded into a measure of “how much variance is phylogenetically structured.”

The zero-inflation question.
As written, your model only allows phylogenetic and covariate effects to influence the conditional expected count, conditional on not being in the “zero-inflated” state. The probability of being in that zero-inflated state is currently treated as constant to be estimated from data — the same for every species. The first thing to decide is whether that’s actually reasonable, or whether you expect the probability of zero-inflation itself to vary with phylogeny or habitat. If you think it plausibly does, you’d need to add a regression formula for that probability too (e.g., a phylogenetic random effect on the zero-inflation probability).

How to report results.
Rather than trying to compute one overall “percent phylogenetically structured” number that spans both parts of the model, report two separate quantities: (1) how much of the variance in the logit-scale binomial proportion is phylogenetically structured, and (2) if you do end up modeling it, how much of the variance in the logit-scale zero-inflation probability is phylogenetically structured. These are answering different questions and shouldn’t be merged.

An important caveat about what’s estimable, which differs between the two parts:

  • Zero-inflation part: If you only have one row of data per species, you can’t estimate a species-level random effect for the zero-inflation probability. This is because, within a single row, the zero-inflated/not-zero-inflated status is essentially a single yes/no observation per species. A random effect needs some replication to distinguish genuine variation from noise, and one binary observation per species doesn’t give you that.
  • Binomial part: This restriction does not automatically apply to the binomial proportion, as long as at least a solid handful of rows contain more than one trial in the binomial distribution. In that case, a species-level random effect on the proportion can be identified even with a single row per species, because the expected sampling variance is already pinned down by the multiple trials.

In summary, if you have just one row per species then it is impossible to study any species-level random effect structure in the zero-inflation part, phylogenetic or otherwise. Proceed with your model as it is, and just report the amount of phylogenetic signal in the binomial part, using the formula that you suggest. If you have multiple rows per species, you might decide it is relevant to study phylogenetic structure in the zero-inflated part as well, in which case you should report the phylogentic signal in both the zero-inflation part of the model and in the binomial part of the model, without attempting to combine them into a single number. In all cases, I would recommend against trying to fold the irreducible binomial sampling variance into your measure of phylogenetic signal. Doing so would be complicated to do, and would obscure rather than reveal actual phylogenetic pattern, because it would confound the actual variance between species probabilities with the irreducible binomial sampling variance.