Total population size

20 views
Skip to first unread message

Chris Sutherland

unread,
Nov 20, 2025, 12:06:16 PM11/20/25
to oSCR
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
get.N.R

Gilles Maurer

unread,
Nov 26, 2025, 10:07:20 AM11/26/25
to oSCR
Dear Chris,

thanks for sharing the function, it works well
Gilles

Kirby Mills

unread,
Dec 9, 2025, 7:36:33 PM12/9/25
to oSCR
Hi Chris, 

Following up on this get.N function, is this something that could be used/tailored to calculate a predicted population size for a larger area than the state space? For example, I'm working with data on an island where the model SS takes up maybe 50% of the total area, but want total N with uncertainty for the whole island. 

I can use get.real() to predict per-pixel densities across the whole island based on the habitat covariates, then scale by pixel area & sum to get a predicted N. However I want to find the best way to get total N for the island while taking into account the uncertainty estimates around the densities, to get an accurate confidence interval around that total population size. Simply adding up predicted the lower/higher CI for N per pixel seems a little crude, so I'm wondering if there's a more elegant solution. 

Would love to hear any suggestions! Sorry if I've missed similar info in earlier conversations, but couldn't find anything by searching. 

Kirby
Reply all
Reply to author
Forward
0 new messages