Hello all,
As mentioned a couple of times in the group, I have a minimally tested function that takes as input a model fitted in oSCR (an oSCR.fit object) and returns the total abundance for the provided state space. Currently, the default is to use the state space that was used to fit the model. It works for single- and multi-session models, as well as models with density covariates - this is probably the majority of use cases, but, as I said, I haven't gotten around to fully testing this and will hold off on adding it to the package until I do. Note this is similar to the `regionN()` function in secr, and has been a very common feature request - sorry for taking so long to get to it. Attached is the function, and below is a demo of how to use it.
I hope this is of some use to the community.
In an exciting aside - we are hoping to get back on the workshop trail next year - keep an eye out for more info!
library(oSCR)
source("get.N.R") # source the attached
#### Single session
data(nybears)
sf <- data2oscr(edf = nybears$edf, sess.col = 1, id.col = 2, occ.col = 3,
trap.col = 4, tdf = list(cbind(nybears$tdf[,1],nybears$tdf[,2:3]/1000)),
K = nybears$K, ntraps = nrow(nybears$tdf), remove.zeros = TRUE,
remove.extracaps = FALSE)$scrFrame
ss <- make.ssDF(sf, buffer = 8, res = 2.5)
fit0 <- oSCR.fit(scrFrame = sf, ssDF = ss) # takes a few minutes
get.N(fit0)
# Estimate SE Lwr Upr
# E.N 78.32446 19.79675 39.52282 117.1261
#### multisession
data(rbs_ecography_mods)
get.N(m1) #D ~ 1
# Estimate SE Lwr Upr
# 1 526.9335 58.03645 413.1821 640.685
# 2 526.9335 58.03645 413.1821 640.685
# 3 526.9335 58.03645 413.1821 640.685
# 4 526.9335 58.03645 413.1821 640.685
get.N(m16) #D ~ session
# Estimate SE Lwr Upr
# 1 370.1293 64.95727 242.8131 497.4455
# 2 763.1394 218.62426 334.6359 1191.6430
# 3 639.6537 107.49766 428.9583 850.3491
# 4 661.1039 201.50048 266.1630 1056.0448