External (temporal) covariate for detection probability

questions concerning analysis/theory using programs M-SURGE, E-SURGE and U-CARE

External (temporal) covariate for detection probability

Postby Roasty247 » Fri Apr 08, 2022 11:20 am

I have data from a study that was done over 20 years with annual surveys and marking, although surveys were conducted every year, survey effort each year is variable and has tended to increase with time, and probably has had an influence on detection. It is my aim to add an 'Effort' external variable as a temporal covariate on detection probability. I have tried this numerous ways, but for some reason it just won't work and I don't know why. The 'Call GEMACO (all phrases)' just throws errors no matter what phrases I try. Can anyone offer any suggestions, please?

I have 20 occasions, 19 ages, 4 events, 3 states and 1 groups. States are non-breeding (NB), breeding (B) and dead (D). Events are not-detected (ND), NB, B, and unknown (UN). Without an external covariate the following model works perfectly:

GEPAT:
Initial state:
Code: Select all
  1 2
1 * p

Transition step 1: Survival
Code: Select all
  1 2 3
1 f - *
2 - f *
3 - - *

Transition step 2: Transition
Code: Select all
  1 2 3
1 * y -
2 y * -
3 - - *

Event step 1: Detection
Code: Select all
  1 2 3
1 * b -
2 * - b
3 * - -

Event step 2: Uncertainty
Code: Select all
  1 2 3 4
1 * - - -
2 - * - d
3 - - * d


GEMACO:
IS: to
T1: from
T2: from.t
E1: firste+nexte.from.t
E2: from

Initial value of 'firste' is fixed at 1.

My external covariate file 'Effort.txt' is in the appropriate format as described in the Manual v1.8, and the same format as other external covariate files I have from tutorial courses which work:
__
1
20
33 97 122 81 28 53 54 86 123 96 136 134 111 139 122 145 156 186 183 243
__

For GEMACO E1 I would expect that the correct phrase to allow detection probability to vary according to survey effort at each time occasion, with different detection probabilities of NB and B states would be:

firste+nexte.from.[i+t*x(1)]

But this doesn't work? I've tried many other formulations but without success. I also tried putting just the last 19 occasions in the effort file, because for time = 1 all are first captures, so nexte in interaction with time might only be estimating 19 occasions? Can somebody see what I would need to do differently, or what the correct approach is?

Thanks in advance
Roasty247
 
Posts: 5
Joined: Mon Mar 14, 2022 6:31 am

Re: External (temporal) covariate for detection probability

Postby simone77 » Sun Apr 10, 2022 5:42 pm

The sentence firste+nexte.from.[i+t*x(1)] is fine and it is correct using an external covariate with 20 values for your dataset. The format of your external covariate seems fine too. I wonder what kind of error is displayed in the terminal (the black window), may you please report it here?

I remember I once had some issue with the code of the "txt" format, a friend of mine used a non-standard (at least to me) one. We solved the issue by saving the txt file with UTF-8 code.

A side-note suggestion: if you're not going to use an age (time-since-marking) effect with 19 age classes, I'd reduce them to the maximum number of age classes you're really using for your models. It would most likely save some computation time.
simone77
 
Posts: 197
Joined: Mon Aug 10, 2009 2:52 pm

Re: External (temporal) covariate for detection probability

Postby Roasty247 » Wed Apr 20, 2022 6:21 am

@simone77 thanks for your reply. I verified that the .txt file was saved with UTF-8 encoding, and this did not solve the problem in this case. (Setting the number of ages to 1 to save calculation also does not change anything). The specific error looks like this:

Code: Select all
-------BEGINNING OF SHORTCUTS LIST-------
POSITION | NAME | VALUE | DEPENDANCE
------END OF SHORTCUTS LIST-----
from is replaces by from
 -\\_:\\\\-\\\Error using Mturlututu
Undetermined error in GEMACO

Error in gemacoV4 (line 51)

Error in interface_gemaco_evt_V4>callGemaco (line 937)

Error in interface_gemaco_evt_V4>Doall_Callback (line 1295)

Error in gui_mainfcn (line 95)

Error in interface_gemaco_evt_V4 (line 52)

Error in matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)interface_gemaco_evt_V4('Doall_Callback',hObject,eventdata,guidata(hObject))

Error using uiwait (line 81)
Error while evaluating Menu Callback.
Roasty247
 
Posts: 5
Joined: Mon Mar 14, 2022 6:31 am

Re: External (temporal) covariate for detection probability

Postby simone77 » Wed Apr 20, 2022 11:09 am

Okay, I see. The number of age classes is purely for the purpose of saving time. It's difficult to pinpoint the source of the problem. You may contact me off-list (by viewing my profile on Phidot). I could create a dummy dataset and use your covariate's text file to see if I can replicate the problem and figure out where it came from.
Best,

Simone
simone77
 
Posts: 197
Joined: Mon Aug 10, 2009 2:52 pm

Re: External (temporal) covariate for detection probability

Postby Roasty247 » Thu Apr 21, 2022 3:19 pm

Solution:

With the help of @simone77 :) , the same analysis was run on another machine with the same files and worked perfectly. The model itself was fine. Back on my machine I eventually figured out that the problem seems to be with the use of an apostrophe (') in the file path to the data files. This didn't seem to be a problem in earlier analysis, but only became a problem/bug when including an external covariate file. Removing the apostrophe made the analysis work, and adding it back made it stop working and seemed to make the error reproducible.

The offending apostrophe was in a folder name "Cory's Shearwater data".
Roasty247
 
Posts: 5
Joined: Mon Mar 14, 2022 6:31 am


Return to analysis help

Who is online

Users browsing this forum: Bing [Bot] and 8 guests