sim.secr steps and output

questions concerning anlysis/theory using program DENSITY and R package secr. Focus on spatially-explicit analysis.

sim.secr steps and output

Postby mobear » Tue Oct 22, 2013 4:42 pm

I’m currently running a suite of simulations using DENSITY 5.0, but since they are taking a very long time to run, I decided to try running them in secr 2.6 to take advantage of multiple cores.

The simulations are to evaluate accuracy of two trap array configurations for estimating black bear density and detection parameters. Ultimately, I want to use relative bias (RB%) and CI coverage to compare parameter estimates from each array configuration.

I’m a little unsure on the proper sequence of steps to achieve the same function as what DENSITY performs and would like some verification before running such time intensive simulations.

My understanding is that I need to first simulate capture histories (sim.capthist) specifying my chosen true density/detection parameter values for each array configuration; then fit a SECR model (secr.fit) to each simulated capture history object; then use sim.secr() to simulate parameter estimates from each fitted SECR model for comparison with my known values.

For example:
> simCH1 <- sim.capthist(traps2012, popn = list(D = 0.0001, mask = tempmask12, Ndist = "poisson"), detectfn = 0, detectpar = list(g0 = 0.1, sigma = 5000), noccasions = 6, nsessions = 1)

> fitCH1 <- secr.fit(simCH1, model=list(D ~ 1, g0 ~ 1, sigma ~ 1), method = "BFGS", mask = tempmask12)

> extrfn <- function (object) predict(object)[c("D","g0","sigma"), -1]

> fitsimCH1 <- sim.secr(fitCH1, nsim = 100, hessian = "auto", extractfn = extrfn, ncores = 4)

The results from a small test run (nsim=10) seem logically correct, but is there a more appropriate method?

Also, is there a way to obtain summary statistics (eg, CV%, RB%, COV) from sim.secr() such as is provided in DENSITY or does this have to be done separately with user-defined functions?

Thanks for the help and clarification!
Clay
mobear
 
Posts: 6
Joined: Thu May 23, 2013 12:56 am

Re: sim.secr steps and output

Postby murray.efford » Wed Oct 23, 2013 5:06 am

Hi Clay

Your use of sim.secr is redundant - just extract what you need from each fit from secr.fit (usually predict() is enough to get what you want from the fitted model).

I'm sorry there is at present no general way to run and summarize a set of simulations in `secr'. The hard bit is to make it elegant and general enough to be worth publishing. I tend to write a custom function that wraps together the sim.capthist and secr.fit steps, run that across multiple cores for the required number of replicates with parLapply, and summarize the resulting list.

Murray
murray.efford
 
Posts: 712
Joined: Mon Sep 29, 2008 7:11 pm
Location: Dunedin, New Zealand


Return to analysis help

Who is online

Users browsing this forum: No registered users and 3 guests