2 Unobservable states in RMark

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

2 Unobservable states in RMark

Postby Andre23 » Thu Oct 16, 2025 7:27 am

I have a re-sighting dataset (all coded "1" from ringing, all ringed same age as juveniles). Re-sightings are all in one observable state (breeders). In the multistrata framework, my aim is to test 2 unobservable states in Rmark (curious to see the difference between this and CJS).

I want to run models where unobservable states are accounted for but without explicit re-sightings recorded. Pre-breeders (state = 2) and post-breeders (state = 3) are temporarily unobservable and assumed to experience survival equivalent to breeders (1). Individuals are ringed, go to an unobservable state (can't be seen at all at age 1 and can start to be seen as breeders from age 2, but most of them will start at age 3). After breeding, they can take 'sabbatical years' (go to an unobservable state again and come back as breeders and seen again).

I used @JeffHostetler trick to include these 2 unobservable states in the ddl:
Code: Select all
rmark_data$ch[1]='1200111111111111010110000003' #introduce 2 more states
ms_proc <- process.data(rmark_data, model = "Multistrata",strata.labels=c('1','2', '3'))
ms_proc$data$ch[1]='10000111111111111010110000000' #go back to original
ddl <- make.design.data(ms_proc)


I fixed parameters for impossible detection or transitions:
Code: Select all
#Unobservable (detection = 0 for non-breeders)
ddl$p$fix[ddl$p$stratum == 2 & ddl$p$stratum==3 ] <- 0
# Age 1 breeders cannot be detected
ddl$p$fix[ddl$p$Age == 1 & ddl$p$stratum == "1"] <- 0
# Set impossible transitions to 0
ddl$Psi$fix[ddl$Psi$stratum == "2" & ddl$Psi$tostratum == "3"] <- 0  # PB to PO
ddl$Psi$fix[ddl$Psi$stratum == "1" & ddl$Psi$tostratum == "2"] <- 0  # B to PB
ddl$Psi$fix[ddl$Psi$stratum == "3" & ddl$Psi$tostratum == "2"] <- 0  # PO to PB
# Transition to breeder (1) only from age 2 minimum
ddl$Psi$fix[ddl$Psi$stratum == "2" &
                 ddl$Psi$tostratum == "1" &
                 (ddl$Psi$Age < 2)] <- 0
#B to PO transition for age < 3 = 0
ddl$Psi$fix[ddl$Psi$stratum == "1" &
                 ddl$Psi$tostratum == "3" &
                 (ddl$Psi$Age < 3)] <- 0
#PO to B transition for age < 4 = 0
ddl$Psi$fix[ddl$Psi$stratum == "3" &
                 ddl$Psi$tostratum == "1" &
                 (ddl$Psi$Age < 4)] <- 0


I'm not used to unobservable state models in Rmark, I have 3 questions:

    1. Is it the correct way to introduce the 2 unobservable states in the ddl?
    2. As the first encounter (ringing event) individuals are not in breeding states (1), should they be coded as another state or should I leave all my sightings as "1"?
    3. How to run the models taking into account this compulsory transition to 2 in the first year and possible transition to 3 after breeding for the first time?
Andre23
 
Posts: 18
Joined: Thu Jun 20, 2024 6:53 am

Re: 2 Unobservable states in RMark

Postby Andre23 » Fri Oct 24, 2025 9:41 am

1. No need to do the trick of manually introducing states in in Rmark

Code: Select all
ms_proc <- process.data(rmark_data, model = "Multistrata",strata.labels=c('1','2', '3')) #works


2. As the first encounter (ringing event) individuals are not in breeding states (1), should they be coded as another state or should I leave all my sightings as "1"?

Yes, first encounter is fledgling (not breeding), should be "2", then the rest of the re-sightings coded as "1"

3. How to run the models taking into account this compulsory transition to 2 in the first year and possible transition to 3 after breeding for the first time?

Code: Select all
#Fix impossible transitions or re-sighting probabilities:
ddl$Psi$fix<-NA
ddl$p$fix<-NA
# States "2" and "3" unobservable (detection = 0)
ddl$p$fix[ddl$p$stratum == 2|ddl$p$stratum==3 ] <- 0
# Age 1 breeders cannot be detected
ddl$p$fix[ddl$p$Age == 1] <- 0

# Set impossible transitions to 0 (survival precedes transition)
ddl$Psi$fix[ddl$Psi$stratum == "2" & ddl$Psi$tostratum == "3"] <- 0  # PB to PO
ddl$Psi$fix[ddl$Psi$stratum == "1" & ddl$Psi$tostratum == "2"] <- 0  # B to PB
ddl$Psi$fix[ddl$Psi$stratum == "3" & ddl$Psi$tostratum == "2"] <- 0  # PO to PB
# Transition from pre-breeder (2) to breeder (1) fixed to 0 at age 1
ddl$Psi$fix[ddl$Psi$stratum == "2" &
                 ddl$Psi$tostratum == "1" &
                 (ddl$Psi$Age < 1)] <- 0
#B to PO transition for age < 3 = 0
ddl$Psi$fix[ddl$Psi$stratum == "1" &
                 ddl$Psi$tostratum == "3" &
                 (ddl$Psi$Age < 2)] <- 0
#PO to B transition for age < 4 = 0
ddl$Psi$fix[ddl$Psi$stratum == "3" &
                 ddl$Psi$tostratum == "1" &
                 (ddl$Psi$Age < 3)] <- 0



Now transitions from 2 to 1 are impossible for individuals < 1yo. Transition to the other unobservable state "3" (post-breeders) is only possible from age 2 after breeding for the first time.
Andre23
 
Posts: 18
Joined: Thu Jun 20, 2024 6:53 am


Return to RMark

Who is online

Users browsing this forum: No registered users and 4 guests