jlaake / marked

R package for analysis of mark-recapture data solely with R
9 stars 9 forks source link

Computing probability of capture histories from fitted models #17

Closed vgherard closed 7 months ago

vgherard commented 7 months ago

Hello again :-)

I've been playing around with marked for a while and I don't seem to find an easy way to compute the probability of a given capture history from a fitted model. Possible applications would be e.g. being able to compute pooled Pearson X2 statistics.

Do you have any recommendation for doing this? Also, would you consider adding a method such as predict.crm() to future versions of the package?

To be clear, by easy I mean without having to manually deconstruct a model object and doing the required algebra by hand.

Thanks in advance! Valerio

jlaake commented 7 months ago

I have been retired for 7 years and I'm not willing to take that on. The code is open source and you or anyone else can adapt as they see fit. As I said in my previous email, I recommend using RMark with MARK as a better alternative. It computes residuals etc and is much more complete.

vgherard commented 7 months ago

Hi, that's totally respectable.

I was actually asking because I could have made a pull request here, since I was trying to develop this by myself. I found a more rapid solution, though.

Regarding what you say about RMark: I have various reasons for sticking with marked, first one being that the code is open source and easily (or not, but at least in principle) adaptable to my analysis needs.

jlaake commented 7 months ago

If you are interested in taking over the marked package, I would gladly hand it over. The next generation needs to take over these software packages.. Gary White has put his MARK software on github but has limited access so far. Marked is a bit of a hodgepodge which is why I'm hesitant to do what you ask. I started with FORTRAN code and optim, moved to ADMB when I learned it and then TMB was released and moved to it. I believe the way forward is to use the hidden Markov model approach with either TMB or the newly developed RTMB which allows models to be specified with R code rather than c++. I started down this path with markedTMB which you'll find as a separate repository. It uses HMM approach with TMB and with it writing out predictions would be easy.

vgherard commented 7 months ago

Oh, I would be interested!

Right now I'm just occasionally working on a problem involving this kind of models, so that I cannot really commit to maintaining a software this big, sorry.

If I have the occasion (meaning: if I have the occasion to get paid to work on capture-recapture data) I will definitely consider this.