RMark robust design CMR

Hello I am working on CMR model with robust design using your RMark pakage , on Rstudio to analyse photo ID data. One of my most important covariates, as I am working, with opportunistic data is the relative effort during my occasions.

I wasn't able to find any example on time covariate incorporation online, and I having some troubles trying to implement it in my probability of detection

I can formulate this effort in term of secondary occasions as well as primary occasions.

I'm wondering if you know any example using the effort this way, as a time covariates, and the way to edit in my code. Mk is my covariate in this case, and I want it to impact p estimation

Thank you very much for any help

time.intervals<-c(0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,1,
0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,
0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,
0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,
0,0,0,0,0,0)

M.proc<-process.data(FD,model="Robust", time.intervals=time.intervals)
p.time.session=list(formula=~time*Mk,share=TRUE)
S.time=list(formula=~time)
GammaDoublePrime.random=list(formula=~time,share=TRUE)
design.parameters=list(S=S.time,
GammaDoublePrime=GammaDoublePrime.random,p=p.time.session)
M.ddl=make.design.data(M.proc,parameters=design.parameters)
model.2=mark(M.proc,M.ddl, model = "Robust",
time.intervals=time.intervals,
model.parameters=design.parameters,threads=2)

It is not clear what do you exactly asks. So you want to make capturability/detectability being a function of something that varies each single occasion (secondary), or just each primary occasion?, like number of camera-traps (only between primary occasions) or number of observers in a vessel (can vary between secondary occasions)?

I suggest you using just the covariate p.time.session = list(formula= ~ Mk).
You should have to have a vector with a value for each session (in your data, a vector of 102 values). If your covariate varies between primary occasions, but not between secondary occasions, you just need to fill them. for example, if you have 3 primary occasions, first of 2 days, second of 4 days, and third of 2 days, and in the first primary period you used 10 cameras, 15 in the second, and 20 in the third, you just populate the vector:

## Number of secondary ocasions
n.occ <- c(2,4,2)
## value of the covariate to model p (number of camera traps in this example)
n.traps <- c(10,15,20)

## expand the covariate
ex.traps <- rep(n.traps, n.occ)

p.cameras <- list(formula = ~ ex.traps)
## and keep going

I would not let p vary though time and at the same time interacting with the covariate, as you have done in your model...

cheers

Hello,
Than you for your answer. It is my effort 5number of picture per event, or time spent taking pictures) consequently I can exprime it either in term of secondary occasions or primary occasions. But I would prefer to do it by secondary occasions.
How do you name your covariate. Just as a list from 1 to 103 (Mk1,Mk2,...Mk103) or with occasions ID ? ( Mk11, for first primary occasions and first secondary occasions, M12 for first primary occasion and second primary occasion? )

I tried your option and my error message is still the same.
"Misspecification of model or internal error in code".

Thanks again for your help

Hi back mate.

I am not sure of what is your issue with RMark. It should be great if you could provide a RePrex (see the link below). The error tht you have can be due to so many things, not necessarily to fitting the re-sighting probability.

But, You should make a vector with the covariate value, no need for any naming long it, just a vector (numeric, s is number of pictures for each secondary occasion). But you cannot use it on primary occasions. There is not such a p (recapture/reshigting probability) there, just survival an emigration/immigration. The p translates to the secondary occasions and is there where you have to decide if use it somehow globally for each primary occasion (and then expanded to all secondary occasions inside, as in my previous example) or let it change for each secondary occasion (that seems sensible as you are taking pictures)..
But anyway, as you link your p to number of pictures, are they of cetacean schools? (dolphins, pilot whales etc). That have an issue of lack of independence on reshigting probabilities, and depending on the final model to be fitted or the actual data, you may have to move to HMM (in R, TMB or Rcpp, hard coding, unfortunately, or outside R, E-Surge, with an user manual quite un-helpful).

Please check the link below
Cheers
Fer

Hello,
Thank you again for your reactivity. My problem was actually coming from the time I added my covariates to my model. I was trying to add them to my database before processing and designing my data. But they got lost in the process. I had a look on the phi dot forum and was able to add them in the good way.
Thanks again for your help

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.