multi-state model for spatial application

posts related to the RMark library, which may not be of general interest to users of 'classic' MARK

multi-state model for spatial application

Postby megpetrie » Tue Jan 08, 2013 3:23 pm

Hello,
I have used RMark in the past to estimate phi and p for several groups of acoustic tagged fish migrating through a water body (spatial form of CJS) . In the past the fish in the model have all taken the same route. Now I've been tasked with including several more populations that don't take the same route, and one of the populations displays split-route migration at t4 recapture occasion and then rejoins for the last recapture occasion t5. To estimate parameters for the probability of movement (Psi) via two routes at t4 and get route specific S, would it be appropriate to use a multi-state model for all populations and constrain Psi for the other populations (those that only took one route) to zero? So basically the encounter histories would have a 1 or 0 for each encounter occasion except t4, which would have an A or B to represent which route was taken. All except one population always went through A, and then one population either went through A or B.
Is there a better way to do this or do you think this will work?

Right now I tried to import some data and am getting an error message that my capture history lengths are not constant. The other part of the issue is that the population with split route migration has only four digit encounter histories. So I added a zero before each one to make them consistent with the other populations (I will be estimating separate p for non-common detection arrays). Is there a trick to importing detection histories with zeros at the beginning?

Thanks,
Megan
megpetrie
 
Posts: 23
Joined: Tue Feb 06, 2007 4:48 pm

Re: multi-state model for spatial application

Postby jlaake » Tue Jan 08, 2013 5:43 pm

Megan-

I suggest using a 2 state model. I would use 1 and 2 as the state values. Your existing values can be left at 1 and then those that split to the alternate route and are seen would be 2. Set Psi 2 to 1 to 0 and all Psi 1 to 2 to 0 for the populations that do not traverse the second route. Also set Psi 1 to 2 to 0 for all occasions until they can split.

All ch have to be the same length so if there are different number of arrays on route 2 you'll have to pad which ever is the smaller. Where you will have problems is if you want to use distance between occasions in place of time to get a survival per unit distance because time intervals must be constant across all individuals.
If you have enough data you could try using a log-link and the distance as a covariate.

There is no trick for getting leading 0's unless you are creating your ch with Excel. They need to be treated as strings or it will remove the leading 0's and will use exponential notation if they are long enough.

--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: multi-state model for spatial application

Postby megpetrie » Tue Jan 08, 2013 6:33 pm

Thanks Jeff. That makes sense. Just to confirm, does the multi-state model basically reduce down to the CJS model when Psi 1 to 2 is fixed at 1 and Psi 2 to 1 is fixed at 0 (for the populations that don't split routes? That is, will I get identical results for non-split populations with the multi-state model that I would using the CJS model?

Megan
megpetrie
 
Posts: 23
Joined: Tue Feb 06, 2007 4:48 pm

Re: multi-state model for spatial application

Postby jlaake » Tue Jan 08, 2013 6:56 pm

I think you meant that Psi 1 to 2 is 0 for those that don't split because then Psi 1 to 1 is 1 (ie they stay on the same path). State 2 is the split. Psi 2 to 1 has to be 0 unless they swim backwards. If you analyze non-splitting and splitting populations together and don't share parameters then you'll get the same results as those when the non-splitting populations were analyzed alone.

If your routes re-join then you need further constraints on Psi. I worked all this out once for folks in USGS who were dealing with dams and routes through the dams. It may be on here on phidot but not sure. It would be possible to automate that type of model structure based on a route diagram using nodes.

In the future I may have an option for MS models with varying time intervals to handle the problem I mentioned with regard to getting survival per unit distance.

--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: multi-state model for spatial application

Postby jlaake » Tue Jan 08, 2013 7:13 pm

On further thought you can handle the varying interval by adding extra occasions to route 1 and set S=1 and p=0 for those extra occasions much like you would do for padded 0s.

For example, if you had a starting point and then 2 stations on route 1 and 3 on route 2, then you would create a ch with 6 occasions.

start route1-1 route1-2 route2-1 route2-2 route2-3

The only Psi would be for the interval between occasion 1 and 2 for Psi 1 to 2 and Psi 1 to 1= 1-Psi 1 to 2 for that occasion. All others would be set to 0 so it would stay in the state(route). You can set the Psi to 0 by deleting the design data for all transitions other than the one you want. The subtract.stratum should be left at default. S=1 and p=0 for state 1 would be set for occasions 4-6 and S=1 and p=0 for state 2 would be set for occasions 2 and 3. Those could be set by deleting the appropriate design data for S and p for those occasions/states. Then you could set time intervals to be distance from start to route1-1, distance from route1-1 to route1-2, distance from start to route2-1, distance from route2-1 to route2-2, and distance from route2-2 to route2-3.

I think some of this was worked out by Mike Melnychuk at UBC for his PhD although last I knew he was doing a postdoc at U. Washington. If he watches this list maybe he'll chime in.

--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: multi-state model for spatial application

Postby megpetrie » Tue Jan 08, 2013 7:40 pm

Hi Jeff,
I corresponded with Mike M. about this and he did recommend a multi-state model for this application.
As for the time interval question, could I just stick to the original plan, omit any distance covariate, and then calculate instantaneous mortality rates (using distance instead of time) for each segment based on S estimates from the model output?

Megan
megpetrie
 
Posts: 23
Joined: Tue Feb 06, 2007 4:48 pm

Re: multi-state model for spatial application

Postby megpetrie » Tue Jan 08, 2013 8:19 pm

Hi Jeff,
Could you also post (or steer me toward) an example of how to delete design data for Psi?

Thanks so much, Megan
megpetrie
 
Posts: 23
Joined: Tue Feb 06, 2007 4:48 pm

Re: multi-state model for spatial application

Postby jlaake » Tue Jan 08, 2013 9:16 pm

Yes you can stick with that. The only advantage of using the distance as the time interval would be that you might get away with a simpler model.

With regard to deleting design data it works the same with Psi as any parameter. Look under Fixing parameters in Appendix C and the workshop notes. An example, might be (not checked for syntax errors)

Code: Select all
ddl$Psi=ddl$Psi[!(ddl$Psi$stratum==2&ddl$Psi$tostratum==1),]


to delete all transitions from 2 to 1.



--jeff
jlaake
 
Posts: 1480
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA

Re: multi-state model for spatial application

Postby mcmelnychuk » Thu Jan 10, 2013 9:20 pm

Hi Megan and Jeff,

I still check the list periodically, and luckily this time I'm only 2 days late. (Yes, still at UW.) Just a couple brief comments to follow up questions/points raised:

> Is there a trick to importing detection histories with zeros at the beginning?

If you do use Excel and if you use a formula to concatenate the detection history string, just format the cells as "general" or text before converting to a csv file or txt file. That way the leading zeros 0001... should be kept. If there are still issues you could try starting the string off with an appostrophe.

> you'll have to pad which ever is the smaller. Where you will have problems
> is if you want to use distance between occasions in place of time to get a
> survival per unit distance because time intervals must be constant across all individuals.

One way to do it is to specify segment distances as time intervals, as mentioned. Another way is just to include segment distances as group & occasion covariates. You'll still get Phi estimates outputted for each segment of each group, they'll just be constrained to the assumption of logit(Phi) varying linearly with segment length. I haven't used this approach with a multi-state model, but I imagine the accounting is similar and that you can code in different segment lengths for the group with the split route at that particular occasion.
If all you're interested in is calculating instantaneous (per-km) mortality rates, M, you could even do that post-hoc as M=-ln(Phi)/d, where Phi is the estimate for the segment and d is the segment length. The uncertainty is handled more elegantly if you can have M as a direct outputted estimate, but if you have troubles that could work for a quick & dirty approach. Note this calculation for M could be used for whatever model you choose, even if it's a more flexible model than a distance-constrained model.

Good luck,
Mike
mcmelnychuk
 
Posts: 24
Joined: Thu Apr 17, 2008 4:11 pm
Location: University of British Columbia

Re: multi-state model for spatial application

Postby TLWilson » Fri Jan 11, 2013 3:29 pm

Hi Megan,

I am really enjoying the great discussion regarding your modeling question. I don't have any advice for the model, but would like to share my solution to making R read leading zeros in a an encounter history. I used the argument colClasses within read.table to force R to import the encounter history as a character field. The example below worked great.

Code: Select all
# use colClasses to keep leading zeros
# dataset has 2 columns: ch and freq
d1 <- read.table('YourFile.txt',
colClasses =c("character","numeric"), sep = "\t", header = TRUE)


hth,
Tammy
TLWilson
 
Posts: 3
Joined: Tue Jan 08, 2013 8:20 pm

Next

Return to RMark

Who is online

Users browsing this forum: No registered users and 1 guest