Dealing with Controlled “transience”

28 views
Skip to first unread message

Mariana Santos

unread,
Jun 1, 2026, 3:36:24 PMJun 1
to nimble...@googlegroups.com
Hello!

My name is Mariana and I'm currently doing my thesis of the master in Conservation Biology. I'm working with multi-event, multi-state capture-mark-recapture models.However, my study design has a particularity that I don't find fully mentioned anywhere:

I'm working with an enclosed European-rabbit population, which means that there is no random emigration/immigration. However, in every capture occasion we release some rabbits to the exterior for the reinforcement of the wild rabbit population, which creates a bias in survival estimation (and it can be considered a controlled emigration :)). Of all captures/recaptures, 46% were released at some point. I have the information of all the individuals that were released, so, what I'm trying to do is to input the capture histories with a right-censoring (RC) column at the end where 1 means the rabbit remains in the enclosure and 2 means it was released. Then I created a vector (“last_capture”) that defines the last capture as the last time a capture history value is different from zero. And I created another vector that defines the following condition: if RC=2, then the last capture that counts for the model is last_capture; if RC=1 then individuals are analysed up to the last capture occasion. However, since I haven't found anything about anyone having done this before, I don't know if this type of models allow me to do it. I have been trying to run the model but it's constantly giving these errors:
[Note] Infinite values were detected in model variable: logProb_y. Compiling [Note] This may take a minute. [Note] Use 'showCompilerOutput = TRUE' to see C++ compilation details. running chain 1... warning: logProb of data node y[1, 1]: logProb is -Inf. warning: logProb of data node y[2, 1]: logProb is -Inf. warning: logProb of data node y[3, 1]: logProb is -Inf. warning: logProb of data node y[4, 1]: logProb is -Inf (etc). 

I also removed from the data the rabbits that were only caught once (which also includes the rabbits that were only caught at the last capture occasion), but the errors persist. I don't know what to change anymore and I was hoping someone could give me an opinion about my conclusions and maybe enlighten me a bit :’)

Thank you so much in advance,

Kind regards,

Mariana Santos 


Daniel Turek

unread,
Jun 5, 2026, 11:42:30 AMJun 5
to Mariana Santos, nimble...@googlegroups.com
Mariana, thanks for sending your question.  I'm sorry that my response is comparatively brief, but I read your email with interest.

The sort of thing you're trying to do is certainly possible.  It would require the correct data structures to represent the capture / release information (as it sounds like you've set up), and associated model code to represent the relationships among the data.  This might require writing a custom distribution for use in the model (written as a nimbleFunction), which is quite doable, and might simplify your entire problem elegantly.  All that said, it's impossible to really see what you're doing with having your present model code, and ideally a reproducible example of the problem.  You're welcome to send that off-list if you prefer, but if you send that along, it'll be much easier to assist.

Cheers,
Daniel


--
You received this message because you are subscribed to the Google Groups "nimble-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nimble-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/nimble-users/CAN4YGepQcf_ZwGTFiY33wV%2Bf-h8HwaFcDiavwajVRfW0RGxsUA%40mail.gmail.com.

Mariana Santos

unread,
Jun 11, 2026, 2:37:35 PM (11 days ago) Jun 11
to nimble-users
Hello, Daniel, and everyone,

Thank you so much for you reply! I'm a newbie in this world so I used AI to help me simulating my data (it's a difficult dataset to simulate :')), so you may find some code chuncks a bit weird. Attached is the R code that I did if you want to take a look. I still have to figure out how to define unequal time intervals and how to tell the model the real time intervals that passed between capture occasions. 

Thank you so much in advance!

Cheers,
Mariana

simulation.R
Reply all
Reply to author
Forward
0 new messages