Package: nimbleSCR 0.2.1

nimbleSCR: Spatial Capture-Recapture (SCR) Methods Using 'nimble'

Provides utility functions, distributions, and fitting methods for Bayesian Spatial Capture-Recapture (SCR) and Open Population Spatial Capture-Recapture (OPSCR) modelling using the nimble package (de Valpine et al. 2017 <doi:10.1080/10618600.2016.1172487 >). Development of the package was motivated primarily by the need for flexible and efficient analysis of large-scale SCR data (Bischof et al. 2020 <doi:10.1073/pnas.2011383117 >). Computational methods and techniques implemented in nimbleSCR include those discussed in Turek et al. 2021 <doi:10.1002/ecs2.3385>; among others. For a recent application of nimbleSCR, see Milleret et al. (2021) <doi:10.1098/rsbl.2021.0128>.

Authors:Richard Bischof [aut], Daniel Turek [aut, cre], Cyril Milleret [aut], Torbjørn Ergon [aut], Pierre Dupont [aut], Soumen Dey [aut], Wei Zhang [aut], Perry de Valpine [aut]

nimbleSCR_0.2.1.tar.gz
nimbleSCR_0.2.1.zip(r-4.7)nimbleSCR_0.2.1.zip(r-4.6)nimbleSCR_0.2.1.zip(r-4.5)
nimbleSCR_0.2.1.tgz(r-4.6-any)nimbleSCR_0.2.1.tgz(r-4.5-any)
nimbleSCR_0.2.1.tar.gz(r-4.7-any)nimbleSCR_0.2.1.tar.gz(r-4.6-any)
nimbleSCR_0.2.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
nimbleSCR/json (API)

# Install 'nimbleSCR' in R:
install.packages('nimbleSCR', repos = c('https://danielturek.r-universe.dev', 'https://cloud.r-project.org'))

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

4.07 score 236 scripts 257 downloads 1 mentions 69 exports 16 dependencies

Last updated from:8449287983. Checks:7 NOTE, 2 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64NOTE160
source / vignettesOK335
linux-release-x86_64NOTE185
macos-release-arm64NOTE96
macos-oldrel-arm64NOTE91
windows-develNOTE216
windows-releaseNOTE105
windows-oldrelNOTE127
wasm-releaseOK119

Exports:calcLocalTrapDistscalcLocalTrapExposurecalculateDensitycalcWindowSizesdbernppACdbernppACmovement_expdbernppACmovement_normaldbernppDetection_normaldbernppLocalACmovement_expdbernppLocalACmovement_normaldbernppLocalDetection_normaldbinom_vectordbinomLocal_expdbinomLocal_normaldbinomLocal_normalPlateaudcatState1Alive1DeaddcatState1Alive2DeaddcatState2Alive2DeaddDispersal_expdHabitatMaskdmultiLocal_normaldnormalizerdpoisLocal_normaldpoisppACdpoisppDetection_normaldpoisppLocalDetection_normalfindLocalTrapsgetHomeRangeAreagetLocalObjectsgetLocalTrapIndicesgetMidPointNodesgetNumLocalTrapsgetSparseYgetWindowCoordsgetWindowIndexintegrateIntensity_expintegrateIntensity_normalintegrateIntensityLocal_expintegrateIntensityLocal_normalmakeConstantNimbleFunctionmakeGridmarginalVoidProbIntegrandmarginalVoidProbNumIntegrationrbernppACrbernppACmovement_exprbernppACmovement_normalrbernppDetection_normalrbernppLocalACmovement_exprbernppLocalACmovement_normalrbernppLocalDetection_normalrbinom_vectorrbinomLocal_exprbinomLocal_normalrbinomLocal_normalPlateaurcatState1Alive1DeadrcatState1Alive2DeadrcatState2Alive2DeadrDispersal_exprHabitatMaskrmultiLocal_normalrnormalizerrpoisLocal_normalrpoisppACrpoisppDetection_normalrpoisppLocalDetection_normalsampler_categorical_generalscaleCoordsToHabitatGridstratRejectionSampler_expstratRejectionSampler_normal

Dependencies:clicodacpp11glueigraphlatticelifecyclemagrittrMatrixnimblenumDerivpkgconfigpracmaR6rlangvctrs

Fit with half-normal plateau detection function and home range size estimation using nimbleSCR package
1. Binomial SCR Model with half-normal plateau detection function | 1.1 Habitat and trapping grid | 1.2 Define SCR model with half-normal plateau detection function | 1.3 Set parameter values to simulate | 1.4 Create data, constants and inits objects | 1.5 Create NIMBLE model | 1.6 Simulate SCR data from the NIMBLE model | 1.7. MCMC with NIMBLE | 1.7.1 Compile the nimble model and create MCMC configuration | 1.7.2 Update the 'adaptive' arguments of MCMC samplers for sigma and w | 1.7.3 Run MCMC | 1.8. Computation of home range size | 2. Calculating home range radius and area with other detection functions | Half-normal (detFun = 0) | Exponential (detFun = 2) | Asymmetric logistic (detFun = 3) | Bimodal (detFun = 4) | Donut (detFun = 5) | REMARK | REFERENCES

Last update: 2022-09-02
Started: 2022-09-02

Point process Bayesian SCR models with nimbleSCR
1. Simulate SCR data | 1.1 Habitat and trapping grid | 1.2 Rescale coordinates | 1.3 Model definition | 1.4 Set up parameter values | 1.5 Create data, constants and initial values | 1.6 Create NIMBLE model | 1.7 Simulate data | 2. Fit model with data augmentation | 2.1. Prepare the input data | 2.2. Run MCMC with NIMBLE | 3. Fit model without data augmentation | 3.1. Model definition | 3.2. Prepare the input data | 3.3. Run MCMC with NIMBLE | REFERENCES

Last update: 2022-09-02
Started: 2021-10-25

Using nimbleSCR to fit 'point process SCR models' to wolverine (Gulo gulo) non-invasive genetic sampling data
Load Libraries | Define 'nimbleSCR' Models | Load Wolverine Data | Create NIMBLE Model | Configure and Build MCMC | Compile and Run MCMC | Results | Conclusion | References

Last update: 2022-09-02
Started: 2022-09-02

Using nimbleSCR to simulate and fit Bayesian SCR models
1. SIMULATE BINOMIAL SCR DATA | 1.1 Habitat and trapping grid | 1.2 Rescale coordinates and local evaluation | 1.3 Define model code | 1.4 Define parameter values to simulate | 1.5 Create data, constants and inits objects | 1.6 Create NIMBLE model | 1.7 Simulate SCR data from the NIMBLE model | 2. RUN MCMC WITH NIMBLE | 3. SIMULATE BINOMIAL SCR DATA WITH TRAP COVARIATES ON $p_0$ | 3.1 Simulate trap covariates | 3.2 Define model code | 3.3 Create NIMBLE model | 3.4 Simulate SCR from the nimble model | 4. RUN MCMC WITH NIMBLE | REFERENCES

Last update: 2022-09-02
Started: 2021-07-01

Wolverine Example
Load Libraries | Load nimbleSCR package | Define Model Structure | Load and Process Data | Use of custom distribution to increase MCMC efficiency | 1. Local detector evaluation | 2. Sparse representation of the observation matrix | 3. Skip unnecessary calculations | Create NIMBLE Model | Configure and Build MCMC | Block sampling to increase MCMC efficiency | Compile and Run MCMC | Results | References

Last update: 2021-07-01
Started: 2021-07-01

Readme and manuals

Help Manual

Help pageTopics
NIMBLE function to calculate the density of individuals alive in each habitat cell.calculateDensity
Window size calculationcalcWindowSizes
Bernoulli point process for the distribution of activity centersdbernppAC rbernppAC
Bernoulli point process for activity center movement (exponential kernel)dbernppACmovement_exp rbernppACmovement_exp
Bernoulli point process for activity center movement (normal kernel)dbernppACmovement_normal rbernppACmovement_normal
Bernoulli point process detection modeldbernppDetection_normal rbernppDetection_normal
Local evaluation of a Bernoulli point process for activity center movement (exponential kernel)dbernppLocalACmovement_exp rbernppLocalACmovement_exp
Local evaluation of a Bernoulli point process for activity center movement (normal kernel)dbernppLocalACmovement_normal rbernppLocalACmovement_normal
Local evaluation for a Bernoulli point process detection modeldbernppLocalDetection_normal rbernppLocalDetection_normal
Vectorized binomial distributiondbinom_vector rbinom_vector
Local evaluation of a binomial SCR observation processdbinomLocal_exp rbinomLocal_exp
Local evaluation of a binomial SCR detection processdbinomLocal_normal rbinomLocal_normal
Local evaluation of a binomial SCR observation processdbinomLocal_normalPlateau rbinomLocal_normalPlateau
Density and random generation of a categorical distribution describing state transition with one alive and one dead states.dcatState1Alive1Dead rcatState1Alive1Dead
Density and random generation of a categorical distribution describing state transition with one alive and two dead states.dcatState1Alive2Dead rcatState1Alive2Dead
Density and random generation of a categorical distribution describing state transition with two alive and two dead states.dcatState2Alive2Dead rcatState2Alive2Dead
Bivariate exponential dispersal distribution for activity centersdDispersal_exp rDispersal_exp
Ones trick distribution for irregular habitat shapesdHabitatMask rHabitatMask
Local evaluation of a multinomial SCR detection processdmultiLocal_normal rmultiLocal_normal
Normalizing constant generatordnormalizer rnormalizer
Local evaluation of a Poisson SCR detection processdpoisLocal_normal rpoisLocal_normal
Poisson point process for the distribution of activity centersdpoisppAC rpoisppAC
Poisson point process detection modeldpoisppDetection_normal rpoisppDetection_normal
Local evaluation for a Poisson point process detection modeldpoisppLocalDetection_normal rpoisppLocalDetection_normal
Computation of home range radius and areagetHomeRangeArea
Local Objects IdentificationgetLocalObjects
Generate midpoint integration nodesgetMidPointNodes
Sparse Matrix PreparationgetSparseY
Get lower and upper windows coordinatesgetWindowCoords
Get window indexgetWindowIndex
Integrate the multivariate exponential intensityintegrateIntensity_exp
Integrate the multivariate normal intensityintegrateIntensity_normal
Integrate the multivariate normal intensity with local evaluationintegrateIntensityLocal_normal
Local Trap CalculationscalcLocalTrapDists calcLocalTrapExposure findLocalTraps getLocalTrapIndices getNumLocalTraps localTrapCalculations makeGrid
Integrand of the marginal void probability integralmarginalVoidProbIntegrand
Marginal void probabilitymarginalVoidProbNumIntegration
'nimble' MCMC sampler function for general categorial distributionssampler_categorical_general
Scale x- and y-coordinates to grid cells coordinates.scaleCoordsToHabitatGrid
Stratified rejection sampler for multivariate exponential point processstratRejectionSampler_exp
Stratified rejection sampler for multivariate normal point processstratRejectionSampler_normal