Informative prior on survival in CJS model with covariates

138 views
Skip to first unread message

Ethan Royal

unread,
Oct 5, 2023, 3:00:30 PM10/5/23
to hmecology: Hierarchical Modeling in Ecology
Hi folks, 

I have a question that might have a very straightforward answer, but I can't find any discussion of it in the literature or this group. I'm working with a fairly basic CJS model in Nimble (recently started to switch from JAGS) that includes two binary covariates; one for sex and one for a tag effect. I have solid estimates for annual survival and the associated SD from CJS analyses on older datasets and I would like to include this information as an informative prior on mean survival in the model with two covariates. 

So, 
1) Is there a conceptual issue with applying an informative prior to a model that includes survival covariates? Would it create problems with interpretation of covariate relationships?

2) What form could an informative prior on mean survival reasonably take, for example, in the following JAGS code copied from Kery and Schaub 2012?

Thanks in advance for any responses. I always learn something useful when visiting this group.

Ethan

# Specify model in BUGS language
cat(file = "cjs-cov.txt", "
model {
   
    # Constraints
    for (i in 1:nind){
       for (t in 1:(n.occasions-1)){
          logit(phi[i,t]) <- mu + beta * x[t] + epsilon[t]
          p[i,t] <- mean.p
          } #t
       } #i
    for (t in 1:(n.occasions-1)){
       epsilon[t] ~ dnorm(0, tau)
       }

    # Derived parameters (could be calculated offline from the mcmc chains)
    for (t in 1:(n.occasions-1)){
       phi.est[t] <- ilogit(mu + beta * x[t] + epsilon[t]) # Yearly survival
       }

    # Priors
    mu ~ dnorm(0, 1)                     # Prior for logit of mean survival
    mean.phi <- ilogit(mu)                   # Logit transformation
    beta ~ dunif(-10, 10)                   # Prior for slope parameter
    sigma ~ dunif(0, 10)                     # Prior on standard deviation
    tau <- pow(sigma, -2)
    sigma2 <- pow(sigma, 2)                  # Residual temporal variance
    mean.p ~ dunif(0, 1)                     # Prior for mean recapture

Marc Kery

unread,
Oct 6, 2023, 3:00:47 AM10/6/23
to Ethan Royal, hmecology: Hierarchical Modeling in Ecology
Dear Ethan,

I see at least two challenges when you want to use external information from an old analysis as an informative prior in the analysis of a new data set:
  • things must be judged similar at the place and times when the old data were collected to what things are now. That is, it must make sense to use the estimates from the other study as a prior in yours
  • you must be able to summarize the posteriors from the old study in the form of a named distribution, so that you can specify this named distribution, with parameters taken from the old study, as a prior for a parameter in the new analysis. That is, you must be able to describe a posterior in the old analysis well with perhaps a normal or a beta distribution, either on the natural scale of a parameter or (more often perhaps) on a transformed scale, such as the log or the logit
To do the latter, you could use a normal with mean and variance given by the mean and the variance of a posterior in the old analysis. So, in the code below you could specify the following prior for the mean survival in the new analysis:

    mu ~ dnorm(old.posterior.mean.of.mu, old.posterior.variance.of.mu)                                     # Assuming a mean/variance parameterization for the normal

I am not quite sure about what you mean by "annual survival". The model you show has random year effects. If the old model was also a random-effects model, then you could perhaps use a log-transformed SD of the annual variance and use the mean and SD of that in a normal distribution to be used as a prior for the log annual variance in the new analysis.

Best regards  --- Marc

PS: When say 'an older data set', I assume there is no overlap between the older data set and the new data? Because if there is, then you're cheating, using the data twice


From: hmec...@googlegroups.com <hmec...@googlegroups.com> on behalf of Ethan Royal <ethr...@gmail.com>
Sent: Thursday, October 5, 2023 21:00
To: hmecology: Hierarchical Modeling in Ecology <hmec...@googlegroups.com>
Subject: Informative prior on survival in CJS model with covariates
 
--
*** Three hierarchical modeling email lists ***
(1) unmarked: for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology (this list): 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 "hmecology: Hierarchical Modeling in Ecology" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hmecology+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hmecology/83c0f603-3dc3-4e8e-8cbf-1ca0381c68een%40googlegroups.com.

Gonçalo Ferraz

unread,
Oct 7, 2023, 2:37:05 PM10/7/23
to hmecology: Hierarchical Modeling in Ecology, Wellen Cristina Alves Bezerra
Hello all,

Graduate student Wellen Alves and myself are analyzing a dataset where male harvestmen (aka daddy longlegs) of two different morphs (big and small guys) may survive differently depending on whether some of their legs where amputated. Individuals never change morph, but they may loose one or more legs in botched molts or in fights among males. 

We want to find out whether amputation (understood as a binary, state-defining variable) has any effect on survival. The main challenge, for us, is that we don’t know whether the individuals that are not seen at a given time still have all their legs. 

Our intuition is to fit a multi-state model to the data. Because harvestmen legs do not grow back after an amputation, the transition from 7 (or fewer) legs back to 8 would be fixed at zero. Also, we would make the transition from 8-legs to amputated, as well as the effect of amputation on survival depend on the morph.

Is this intuition reasonable? Would anyone try instead to fit a standard CJS model (meaning not multi-state) with some form of time-changing individual covariates?

Thanks for reading!

Best,

Gonçalo 


Gonçalo Ferraz
Laboratório de Biologia de Populações
Departamento de Ecologia, Instituto de Biociências
Universidade Federal do Rio Grande do Sul

Marc Kery

unread,
Oct 7, 2023, 3:33:21 PM10/7/23
to Gonçalo Ferraz, hmecology: Hierarchical Modeling in Ecology, Wellen Cristina Alves Bezerra
Dear Goncalo,

if amputation is an experimental treatment, then why do you have to model it as time-varying ? Because some non-amputated will naturally lose a leg or two and then in a way transition to the amputated group ? I think the easiest would simply be to treat amputation as a grouping variable and ignore any changes over time. If changes are rare, then ignoring them should not matter that much. And if you then still find a difference between the two groups you can argue that in reality the effect of one fewer leg is even bigger.

Best regards  --- Marc


 

From: hmec...@googlegroups.com <hmec...@googlegroups.com> on behalf of Gonçalo Ferraz <gfer...@gmail.com>
Sent: Saturday, October 7, 2023 20:36

To: hmecology: Hierarchical Modeling in Ecology <hmec...@googlegroups.com>
Cc: Wellen Cristina Alves Bezerra <wel...@ib.usp.br>
Subject: CJS with time-changing individual covariates OR multi-state ?
 
--
*** Three hierarchical modeling email lists ***
(1) unmarked: for questions specific to the R package unmarked
(2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
(3) HMecology (this list): 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 "hmecology: Hierarchical Modeling in Ecology" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hmecology+...@googlegroups.com.

Gonçalo Ferraz

unread,
Oct 7, 2023, 3:46:38 PM10/7/23
to Marc Kery, hmecology: Hierarchical Modeling in Ecology, Wellen Cristina Alves Bezerra
Hello Marc,

Amputation is not an experimental treatment. It happens during fights between males and we never see it happening, we only see some animals showing up with fewer than eight legs. That is why we can’t always know whether a male has all the legs in the occasions when it is not captured.

We were just looking at the model for estimation of movement between two sites, at the beginning of chapter 9 of the BPA book. This model, with one of the transitions zeroed out, is looking quite appropriate to what we need to do. One alternative that I considered is the Catchpole et al. (2008) variant of CJS with time-varying individuals covariates. The Catchpole et al. model seems interesting in not including information from the times when the individuals where not seen—if I got it correctly— but it also appears much more difficult to implement than the multi-state approach.

Best,

Gonçalo

Thomas Riecke

unread,
Oct 8, 2023, 12:30:58 PM10/8/23
to Gonçalo Ferraz, Marc Kery, hmecology: Hierarchical Modeling in Ecology, Wellen Cristina Alves Bezerra
Hello Gonçalo and Wellen,

What an interesting study! You could use either approach, and they will (if set up correctly) return the same estimates. Below I didn't deal with the 'morph' issue, but it seems easy to work in.

The multistate approach allows for transitioning between 3 states (alive with 8 legs, alive with less than 8 legs, and dead) using a categorical distribution. The CJS approach has two 'layers' of Bernoulli's. It may take a bit of tinkering to figure out how to set up the code. I think something like a capture history of 1's and 0's, and a separate 'capture history' of 1's if the individual had all of it's legs, 0's if it didn't, and NAs if not observed

If we call that separate capture history 'l', then
legs[i,t] ~ Bernoulli(l[i,t-1] * gamma) 
where gamma is the probability of staying an eight-legged daddy long-legs, once the long-legs becomes a seven or less legged spider, then it cannot transition back as l[i,t] = 0 and the probability of the Bernoulli will always be zero moving forward.

we can then model the survivals as
z[i,t] ~ Bernoulli(z[i,t-1] * phi[legs[i,t-1] + 1]) 
which will give us phi[1] if legs[i,t-1] = 0, and phi[2] if legs[i,t-1] = 1

I can send you some code if you would like early this week, apologies, not in the office at the moment. You will need to provide good initial values and/or the known states (legs or no legs, alive or not alive) as data. But the key take-home is that the probabilities of the dual Bernoulli approach are the same as the probabilities of a multistate model with three states. Sometimes I find the Bernoullis easier to code (and faster), and sometimes they are not. Anyway, just my two cents that it seems you are deciding between two different roads that will take you to the same place, and both will work well. 

Best wishes,

Thomas

On Sat, Oct 7, 2023 at 1:46 PM Gonçalo Ferraz <gfer...@gmail.com> wrote:

[EXTERNAL EMAIL]


To view this discussion on the web visit https://groups.google.com/d/msgid/hmecology/B5E18DA6-B6D9-41E0-9180-97C9D82B1825%40gmail.com.

This email originated outside of the University of Nevada, Reno. Do not click on links or attachments unless you recognize the sender and know the content is safe. Report suspicious emails to the Office of Information Technology (OIT) at ab...@unr.edu.

On Sat, Oct 7, 2023 at 1:46 PM Gonçalo Ferraz <gfer...@gmail.com> wrote:

[EXTERNAL EMAIL]


To view this discussion on the web visit https://groups.google.com/d/msgid/hmecology/B5E18DA6-B6D9-41E0-9180-97C9D82B1825%40gmail.com.

This email originated outside of the University of Nevada, Reno. Do not click on links or attachments unless you recognize the sender and know the content is safe. Report suspicious emails to the Office of Information Technology (OIT) at ab...@unr.edu.

Reply all
Reply to author
Forward
0 new messages