Hello,
Apologies for cross-posting.
We developed an integrated population model (IPM) for a marine mammal that we're now adapting in various ways. One of these adaptations is to build in density dependence in reproductive probabilities:
# reproduction
for(i in 1:nYearsRepro){
ggb[i] <- ilogit(rep.betas[i])
rep.betas[i] <- rep.inter + rep.coef * (Ntot[i] / K[i]) + kappa[i]
kappa[i] ~ dnorm(0, rep.prec)
}
When we try to define the model in NIMBLE, we get the following error message:
Error in igraph::topo_sort(graph, mode = "out") :
At vendor/cigraph/src/properties/dag.c:125 : The graph has cycles; topological sorting is only possible in acyclic graphs. Invalid value
Since this is the same model of density dependence used in many other IPMs, except for the time-varying carrying capacity (K; which we're not trying to estimate in the IPM), I suspect the error message is due to the workarounds we set up to allow this sort of modeling where the data are not the direct reproductive data but previously estimated reproductive probabilities:
rep.mu[1:nYearsRepro] ~ dmnorm(rep.betas[1:nYearsRepro],
cov = rep.vcv[1:nYearsRepro,1:nYearsRepro])
rep.prec ~ dgamma(0.001, 0.001)
rep.sd <- rep.prec ^ -0.5
rep.inter ~ dnorm(0, sd = 3)
rep.coef ~ dnorm(0, sd = 3)
Does anyone know of a way we can make density dependence work within this IPM, short of duplicating previously developed complex mark-recapture models implemented in MARK?
Reproducible example attached.
Thank you,
Jeff
Jeffrey A. Hostetler, Ph.D.
Research Biologist
U.S. Geological Survey
Eastern Ecological Science Center
12100 Beech Forest Road
Laurel, MD 20708
USGS Staff Profile | ORCID