estimating number of new recruits per survey in Dail-Madsen N-mixture model

45 views
Skip to first unread message

David Rosenbaum

unread,
Nov 24, 2025, 3:04:17 PMNov 24
to unmarked
Hi all,

I have been fitting Dail-Madsen N-mixture models in unmarked using function pcountOpen(), and with dynamics set to "constant." I have a covariate of gamma/immigration, which changes value during each primary period (I am not modeling closed/secondary survey periods). This covariate has a unimodal relationship with survey dates, so immigration rate and abundance increase during middle surveys and decrease during ending survey periods (ranef() and bup() show abundances gradually increasing and then dropping again through time across surveys.

I would like to estimate the number of gains to the population each survey period. Using predict() with values of my immigration covariate, I've outputted model-estimated immigration rate for each survey. I was under the impression that if I multiplied predicted gamma at survey 2 * lambda at survey 1, this would grant an estimate of the mean number of new recruits in survey 2. 
Continuing this line of thought throughout surveys, If I multiplied gamma of survey 3 by the calculated number of individuals estimated in survey 2 ( (survey 2 recruitment rate* lambda) + (survival rate * lambda) ), and gamma at survey 4 by the number of individuals estimated in survey 3 ((survey 3 recruitment rate * survey 2 abun.) + (survival rate * survey 2 abu.n) ), I figured I could continue down and estimate number of recruits for all surveys. However, this leads to abundance estimates that continue to increase through time, when according the the model, abundance should drop in the latter surveys since predicted immigration rate drops towards the end of the survey window.

Would anyone be able to provide insight on what I may be missing here? Am I miscalculating recruitment rate or misunderstanding the relationship between the model parameters? 

Thank you,
David

Marc Kery

unread,
Nov 25, 2025, 1:53:54 AMNov 25
to unmarked
Dear David,

I think you confuse dynamics = "constant" with dynamics = 'autoreg'. See here in the help text of the function:

"Character string describing the type of population dynamics. "constant" indicates that there is no relationship between omega and gamma. "autoreg" is an auto-regressive model in which recruitment is modeled as gamma*N[i,t-1]."

[On a side-note, I wonder whether 'omega' should be replaced with lambda or possibly N ?].

So, your predictions should yield directly what you want.

Best regards  --- Marc



From: unma...@googlegroups.com <unma...@googlegroups.com> on behalf of David Rosenbaum <rsnb...@gmail.com>
Sent: Monday, November 24, 2025 20:54
To: unmarked <unma...@googlegroups.com>
Subject: [unmarked] estimating number of new recruits per survey in Dail-Madsen N-mixture model
 
--
*** Three hierarchical modeling email lists ***
(1) unmarked (this list): for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
---
You received this message because you are subscribed to the Google Groups "unmarked" group.
To unsubscribe from this group and stop receiving emails from it, send an email to unmarked+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/unmarked/2983da59-2b5a-49a7-ad9f-77f441e9bff4n%40googlegroups.com.

Richard Chandler

unread,
Dec 2, 2025, 9:33:41 AMDec 2
to unmarked
Hi Marc, you're right that the documentation wasn't very clear, so I tried to clean it up a bit. The changes are up on github and will be included in the next release. 

David, I also wrote some code to show how to compute the *realized* number of recruits summed over sites, for each time period. The 'predict' method applied to a fitted model will give you the *expected* values of recruitment (or per-capita recruitment, depending on the 'dynamics' you specify). The predict method applied to the output of 'ranef' lets you do posterior prediction, the empirical Bayes way. Both the expected values and the realized values may be useful. This code requires the development version of unmarked on github. Hope it helps. 


example(pcountOpen) # Run the example code first re <- ranef(m1) plot(re, layout=c(5,5), subset = site %in% 1:25 & year %in% 1:2, xlim=c(-1,15))     G           # Matrix of recruits from simulation in example sim_conditional_recruits <- function(x, fm) {  N <- x ## To be clear that x is abundance  dynamics <- fm@dynamics
if(fm@immigration)
warning("Ignoring immigration")  n_sites <- nrow(x)  n_years <- ncol(x)  gam_vec <- predict(fm, type="gamma")$Predicted  gam <- matrix(gam_vec, n_sites, n_years-1)  omega_vec <- predict(fm, type="omega")$Predicted  omega <- matrix(omega_vec, n_sites, n_years-1)  S <- matrix(NA_integer_, n_sites, n_years-1) # Survivors  G <- matrix(NA_integer_, n_sites, n_years-1) # Recruits  rcat <- function(probs) which(rmultinom(n=1, size=1, prob=probs)==1)  for(i in 1:n_sites) {    for(t in 2:n_years) {      possible_survivors <- 0:N[i,t-1]      possible_recruits <- N[i,t]-possible_survivors      p_survivors <- dbinom(possible_survivors, N[i,t-1], omega[i,t-1])      if(dynamics=="constant")        p_recruits <- dpois(possible_recruits, gam[i,t-1])      else if(dynamics=="autoreg")        p_recruits <- dpois(possible_recruits, gam[i,t-1]*N[i,t-1])      else        stop("dynamics not implemented")      p_joint0 <- p_survivors*p_recruits      p_joint <- p_joint0/sum(p_joint0)      index <- rcat(p_joint)      S[i,t-1] <- possible_survivors[index]      G[i,t-1] <- possible_recruits[index]    }  }  return(G=colSums(G)) }
# Posterior prediction, using Empirical Bayes G_post <- predict(re, func=sim_conditional_recruits, nsims=10, fm=m1) rowMeans(G_post) ## Estimates of *realized* recruits per time interval apply(G_post, 1, quantile, probs=c(0.025, 0.975)) colSums(G)  # Actual recruits per time interval (from simulated data) gam*M       # Estimate of the expected number of recruits per interval


Richard


--
Richard Chandler
Professor
Wildlife Ecology and Conservation
Warnell School of Forestry and Natural Resources
University of Georgia

From: unma...@googlegroups.com <unma...@googlegroups.com> on behalf of Marc Kery <marc...@vogelwarte.ch>
Sent: Tuesday, November 25, 2025 1:53 AM
To: unmarked <unma...@googlegroups.com>
Subject: Re: [unmarked] estimating number of new recruits per survey in Dail-Madsen N-mixture model
 
[EXTERNAL SENDER - PROCEED CAUTIOUSLY]

Marc Kery

unread,
Dec 7, 2025, 6:56:02 AM (11 days ago) Dec 7
to unmarked
Great, thanks a lot, Richard !

Marc


From: 'Richard Chandler' via unmarked <unma...@googlegroups.com>
Sent: Tuesday, December 2, 2025 15:33
Reply all
Reply to author
Forward
0 new messages