oSCR.parfit: Parallel (multi-core) model fitting for oSCR

View source: R/oSCR.parfit.R

oSCR.parfitR Documentation

Parallel (multi-core) model fitting for oSCR

Description

This is a wrapper that executes oSCR.fit for multiple cores using doParallel.

Usage

oSCR.parfit(mods, data, ncores = 2)

Arguments

mods

A table of models to fit, see make.mods()

data

A list with the required oSCR.fit objects: data$sf = scrFrame, data$ss = ssDF, data$cs = costDF

For example, the function sim.SCR.ms produces the correct objects (see below)

ncores

How many cores should be used to fit the models?

Details

Uses the doParallel package.....

Value

an oSCR fitList object

Author(s)

Andy Royle

See Also

make.mods

Examples



mods <- make.mods(density= c(~1,~session),
                  detection = c(~1,~session),
                  sigma = c(~1,~session),
                  cost = c(~1))
 
data<- sim.SCR.ms(sessions=2, sex=TRUE, sex.ratio=0.5, N = 100, K = 3,
                       alpha0 = -1.5, sigma = 0.5, discard0 = TRUE,
                       array3d = FALSE, ssRes = 0.5) 
 
# Note: In practice, allowing for model-specific starting values will probably
# be necessary to avoid crashes. Not done yet.

fmL <- oSCR.parfit(mods=mods, scrFrame=data$sf, ssDF=data$ssDF, ncores=4)


jaroyle/oSCR documentation built on Sept. 23, 2023, 12:46 p.m.