pop.est function with fixed p values

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

pop.est function with fixed p values

Postby SoConfused » Mon Jan 21, 2019 1:36 pm

Hello,

I was attempting to use pop.est to calculate abundances based on a CJS model. However, I have a few p values fixed to 0 (because there were only releases of marks, without any capture effort in those years). The function outputs NaN, presumably due to the zero variance in those years.

Is there a way to work around this?
Thank you!

Here's example code with dipper:
Code: Select all
library(RMark)
data(dipper)

data1.proc <- process.data(dipper, model="CJS", begin.time = 2000, groups = "sex") 
data1.ddl <- make.design.data(data1.proc)

## set a few p values to fixed 0
p.indices=as.numeric(row.names(data1.ddl$p[data1.ddl$p$time %in% c(2005, 2006) &
                           data1.ddl$p$sex == "Female",]))
p.values=rep(0,length(p.indices))

data1.analysis=function(){   
   Phi.1 = list(formula= ~ 1)
   p.t = list(formula=~ time, fixed=list(index=p.indices, value=p.values))
   cml=create.model.list("CJS")
   mark.wrapper(cml,data=data1.proc, ddl=data1.ddl, output=FALSE, delete = FALSE)
           }
 
data1.results <- data1.analysis()

md <- data1.results[[1]]
xmat <- matrix(as.numeric(unlist(strsplit(dipper$ch,""))), ncol=nchar(dipper$ch[1]))
ns <- colSums(xmat)[-1]

# calculate pop estimates
df <- data.frame(group=rep(1,6), row=c(1:6),col=c(1:6))
p.indices <- extract.indices(md,"p",df=df)
p.list <- covariate.predictions(md,data=data.frame(index=p.indices))
pop.est(ns, p.list$estimates$estimate, design=diag(1,ncol=length(unique(df$row)),nrow=length(unique(df$col))),p.list$vcv)
 
SoConfused
 
Posts: 53
Joined: Wed Nov 05, 2014 8:25 am

Re: pop.est function with fixed p values

Postby cooch » Mon Jan 21, 2019 2:58 pm

SoConfused wrote:Hello,

I was attempting to use pop.est to calculate abundances based on a CJS model. However, I have a few p values fixed to 0 (because there were only releases of marks, without any capture effort in those years). The function outputs NaN, presumably due to the zero variance in those years.


So, if I'm reading this correctly, you want abundance estimates for days when you don't have the ability to estimate p (which you fix to zero). Given that N=count/p, then since you don't have the denominator, guess what NaN means? ;-)

Is there a way to work around this?
Thank you!


See above. You have no data, per se, for the years with no capture effort, so what would you base inference on?

You might be able to tell stories, since the problem amounts to 'missing occasions', or 'unequal intervals' (not entirely equivalent -- see sidebar starting bottom of p. 24 in Chapter 4), but it would be tricky to come up with something convincing.
cooch
 
Posts: 1628
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: pop.est function with fixed p values

Postby SoConfused » Mon Jan 21, 2019 3:44 pm

Yeah, I figured that I was dividing by a zero - nothing out of the ordinary ;-)

My thinking was that since p / phi aren't time-specific (other than the fixed values), would it not be possible to estimate survival from the sampled events, followed by simple addition of the marked animals? So if I had proper mark / capture effort on events 1, 2, 3, 4 but only marking on 5 and 6 - on day 5, I should have animals that survived from events 1-4 plus all the animals that were tagged on event 5... Is that flawed?
SoConfused
 
Posts: 53
Joined: Wed Nov 05, 2014 8:25 am

Re: pop.est function with fixed p values

Postby cooch » Mon Jan 21, 2019 3:55 pm

SoConfused wrote:Yeah, I figured that I was dividing by a zero - nothing out of the ordinary ;-)

My thinking was that since p / phi aren't time-specific (other than the fixed values), would it not be possible to estimate survival from the sampled events, followed by simple addition of the marked animals? So if I had proper mark / capture effort on events 1, 2, 3, 4 but only marking on 5 and 6 - on day 5, I should have animals that survived from events 1-4 plus all the animals that were tagged on event 5... Is that flawed?


Again, look at the canonical estimator for abundance: number detected at least once, divided by encounter probability: \hat{N}=C/\hat{p}. You might be willing to assume you know something about the denominator, but you have precious little information about the numerator. You know how many newly marked individuals there are, but beyond making heroic assumptions about how many individuals might have survived from periods {1-4} -> {5} (and even that would be quite tricky), you don't have what you need to estimate abundance.

Sorry, but to quote Darryl MacKenzie: 'these methods are statistical, but not magical'.
cooch
 
Posts: 1628
Joined: Thu May 15, 2003 4:11 pm
Location: Cornell University

Re: pop.est function with fixed p values

Postby SoConfused » Tue Jan 22, 2019 6:48 am

Got it. Since the population in question is all hatchery-stocking (with no expected breeding), I think I'm thinking of this exercise as a projection - if you stock x fish in year y, how many are still there by year z. Which is not what the function is meant to do.
SoConfused
 
Posts: 53
Joined: Wed Nov 05, 2014 8:25 am


Return to RMark

Who is online

Users browsing this forum: Google [Bot] and 7 guests