simHMM and sampling effort

questions concerning analysis/theory using the R package 'marked'

simHMM and sampling effort

Postby SoConfused » Sat Nov 09, 2019 12:59 pm

Cross-posting here from the RMark forum, since posted there by mistake and couldn't figure out how to delete the original post...

I would like to simulate data under a series of sampling effort values to compare estimate precision. I'm hung up on how to do that using the simHMM framework. Below is a toy example. Let's assume that the data were collected using 100 traps, and I would like to simulate 150 traps, under an assumption of linear increase of catch.

It is my understanding that this should be simulated as a doubling of the new animals (freq in df below) and in a doubling of the recap probability. However, the function takes in values of beta (logit space), not raw recap probs. My actual model is somewhat complex (something like group * time + factor, for example), so I'm looking for a generic solution if possible.

fake data:
Code: Select all
library(dplyr)
library(marked)

df <- structure(list(ch = c("100000000000", "100000000000", "100000000000",
"010000000000", "010000000000", "010000000000", "001000000000",
"001000000000", "001000000000", "000100000000", "000100000000",
"000100000000", "000010000000", "000010000000", "000010000000",
"000001000000", "000001000000"), Group = structure(c(1L,
2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L, 3L, 1L, 2L
), .Label = c("a", "b", "c"), class = "factor"), freq = c(21,
14, 3, 47, 62, 14, 48, 43, 8, 64, 67, 25, 65, 63, 17, 82, 55)), row.names = c(1L,
2L, 3L, 6L, 7L, 8L, 15L, 16L, 17L, 24L, 25L, 26L, 33L, 34L, 35L,
43L, 44L), class = "data.frame")


Then specifying the sim structure
Code: Select all
modelspec <- list(Phi = list(formula = ~ 1),   p = list(formula = ~ 1))
dp.sim <- marked::process.data(df, model="HMMcjs")
ddl.sim <- marked::make.design.data(dp.sim)
               
phi <- 1
p <- -2.8
   
initial <- list(Phi = phi,   p = p)
realization <- simHMM(dp.sim, ddl.sim, model="HMMcjs", model.parameters = modelspec, initial = initial)
SoConfused
 
Posts: 53
Joined: Wed Nov 05, 2014 8:25 am

Re: simHMM and sampling effort

Postby jlaake » Mon Nov 11, 2019 12:41 pm

A couple of things. First for CJS the freq are the number released which has nothing to do with p because p is only estimated for occasions post release. So you can increase p but leave the number of releases the same.
Second, the reason for using the logit or other transformations is to bound p between 0 and 1. So you can't arbitrarily double p. Imagine if p=0.6. Doubling it would be 1.2 which is not a valid probability. You have to work with odds = (p/(1-p)) or log odds = log(odds) = beta parameter space. If p=0.1 the odds are 1/9. If you double odds to 2/9 and do the algebra you'll find that p=2/11= 0.182 which almost doubles p but not quite.
I don't think there is a generic solution for what you want to do with a formula. Note that if beta is the parameter value then exp(beta)=odds but with a formula you won't have a single beta.

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

Re: simHMM and sampling effort

Postby jlaake » Tue Nov 12, 2019 12:26 pm

Hopefully it is obvious but forgot to mention that you can work out value of beta that gives you a true doubling of p but there won't be a valid solution once p > .5.
jlaake
 
Posts: 1417
Joined: Fri May 12, 2006 12:50 pm
Location: Escondido, CA


Return to analysis help

Who is online

Users browsing this forum: No registered users and 12 guests