Learn R Programming

mrds - Mark-Recapture Distance Sampling

What is mrds?

This package for R analyzes single or double observer distance sampling data for line or point sampling. It is used in program DISTANCE as one of the analysis engines. Supported double observer configurations include independent, trial and removal. Not all options in mrds are fully supported via DISTANCE.

If you only wish to perform a conventional or multiple covariate distance sampling analysis (CDS/MCDS) (as opposed to a double observer analysis), you may want to try the Distance R package, which has a simplified interface and is available from https://github.com/DistanceDevelopment/Distance.

Getting mrds

The easiest way to ensure you have the latest version of mrds, is to install using the remotes package:

  install.packages("remotes")

then install mrds from github:

  library(remotes)
  install_github("DistanceDevelopment/mrds")

Otherwise:

  • One can download a Windows package binary using the "Releases" tab in github. To install in R, from the R menu, use "Packages\Install from Local Zip file" and browse to location of downloaded zip.
  • Or, download package source files.
  • Finally the current stable version of mrds is available on CRAN, though this may be up to a month out of date due to CRAN policy.

References

The following are references for the methods used in the package.

Burt, M. L., D. L. Borchers, K. J. Jenkins and T. A. Marques. (2014). "Using mark-recapture distance sampling methods on line transect surveys." Methods in Ecology and Evolution 5: 1180-1191.

Buckland, S. T., J. Laake, et al. (2010). "Double observer line transect methods: levels of independence." Biometrics 66: 169-177.

Borchers, D. L., J. L. Laake, et al. (2006). "Accommodating unmodeled heterogeneity in double-observer distance sampling surveys." Biometrics 62(2): 372-378.

Buckland, S. T., D. R. Anderson, et al., Eds. (2004). Advanced distance sampling: estimating abundance of biological populations. Oxford, UK; New York, Oxford University Press. (see chapter 6).

Copy Link

Version

Install

install.packages('mrds')

Monthly Downloads

1,723

Version

2.3.0

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

December 18th, 2023

Functions in mrds (2.3.0)

check.mono

Check that a detection function is monotone
create.ddfobj

Create detection function object
create.command.file

create.command.file
ddf.gof

Goodness of fit tests for distance sampling models
create.model.frame

Create a model frame for ddf fitting
ddf

Distance Detection Function Fitting
create.varstructure

Creates structures needed to compute abundance and variance
ddf.ds

CDS/MCDS Distance Detection Function Fitting
ddf.rem

Mark-Recapture Distance Sampling (MRDS) Removal - PI
ddf.io

Mark-Recapture Distance Sampling (MRDS) IO - PI
ddf.io.fi

Mark-Recapture Distance Sampling (MRDS) IO - FI
det.tables

Observation detection tables
dht.se

Variance and confidence intervals for density and abundance estimates
detfct.fit

Fit detection function using key-adjustment functions
detfct.fit.opt

Fit detection function using key-adjustment functions
distpdf

Detection functions
ddf.rem.fi

Mark-Recapture Distance Sampling (MRDS) Removal - FI
ddf.trial.fi

Mark-Recapture Analysis of Trial Configuration - FI
integratedetfct.logistic

Integrate a logistic detection function
ds.function

Distance Sampling Functions
histline

Plot histogram line
integratelogistic.analytic

Analytically integrate logistic detection function
gof.ds

Compute chi-square goodness-of-fit test for ds models
g0

Compute value of p(0) using a logit formulation
flt.var

Hessian computation for fitted distance detection function model parameters
gstdint

Integral of pdf of distances
getpar

Extraction and assignment of parameters to vector
dht.deriv

Computes abundance estimates at specified parameter values using Horvitz-Thompson-like estimator
dht

Density and abundance estimates and variances
keyfct.tpn

Two-part normal key function
ddf.trial

Mark-Recapture Distance Sampling (MRDS) Trial Configuration - PI
is.logistic.constant

Is a logit model constant for all observations?
flnl

Log-likelihood computation for distance sampling data
is.linear.logistic

Collection of functions for logistic detection functions
integratepdf

Numerically integrate pdf of observed distances over specified ranges
lfbcvi

Black-capped vireo mark-recapture distance sampling analysis
keyfct.th2

Threshold key function
keyfct.th1

Threshold key function
logisticbyx

Logistic as a function of covariates
logisticdupbyx_fast

Logistic for duplicates as a function of covariates (fast)
logLik.ddf

log-likelihood value for a fitted detection function
io.glm

Iterative offset GLM/GAM for fitting detection function
logisticbyz

Logistic as a function of distance
logisticdetfct

Logistic detection function
MCDS.exe

Run MCDS.exe as a backend for mrds
mcds

MCDS function definition
lfgcwa

Golden-cheeked warbler mark-recapture distance sampling analysis
mrds-package

Mark-Recapture Distance Sampling (mrds)
logisticdupbyx

Logistic for duplicates as a function of covariates
mrds_opt

Tips on optimisation issues in mrds models
logit

Logit function
plot.det.tables

Observation detection tables
nlminb_wrapper

Wrapper around nlminb
p.dist.table

Distribution of probabilities of detection
pdot.dsr.integrate.logistic

Compute probability that a object was detected by at least one observer
plot.ds

Plot fit of detection functions and histograms of data from distance sampling model
p.det

Double-platform detection probability
plot.io

Plot fit of detection functions and histograms of data from distance sampling independent observer (io) model
plot.rem

Plot fit of detection functions and histograms of data from removal distance sampling model
plot.io.fi

Plot fit of detection functions and histograms of data from distance sampling independent observer model with full independence (io.fi)
plot.trial

Plot fit of detection functions and histograms of data from distance sampling trial observer model
plot_layout

Layout for plot methods in mrds
parse.optimx

Parse optimx results and present a nice object
print.ddf

Simple pretty printer for distance sampling analyses
plot.rem.fi

Plot fit of detection functions and histograms of data from removal distance sampling model
plot_uncond

Plot unconditional detection function from distance sampling model
plot.trial.fi

Plot fit of detection functions and histograms of data from distance sampling trial observer model
plot_cond

Plot conditional detection function from distance sampling model
print.ddf.gof

Prints results of goodness of fit tests for detection functions
print.det.tables

Print results of observer detection tables
predict.ds

Predictions from mrds models
print.p_dist_table

Print distribution of probabilities of detection
prob.deriv

Derivatives for variance of average p and average p(0) variance
print.summary.ds

Print summary of distance detection function model object
print.summary.rem.fi

Print summary of distance detection function model object
print.dht

Prints density and abundance estimates
print.summary.trial.fi

Print summary of distance detection function model object
rem.glm

Iterative offset model fitting of mark-recapture with removal model
print.summary.trial

Print summary of distance detection function model object
prob.se

Average p and average p(0) variance
rescale_pars

Calculate the parameter rescaling for parameters associated with covariates
print.summary.io.fi

Print summary of distance detection function model object
ptdata.distance

Single observer point count data example from Distance
print.summary.io

Print summary of distance detection function model object
ptdata.dual

Simulated dual observer point count data
pronghorn

Pronghorn aerial survey data from Wyoming
ptdata.removal

Simulated removal observer point count data
process.data

Process data for fitting distance sampling detection function
sim.mix

Simulation of distance sampling data via mixture models Allows one to simulate line transect distance sampling data using a mixture of half-normal detection functions.
solvecov

Invert of covariance matrices
stake77

Wooden stake data from 1977 survey
sample_ddf

Generate data from a fitted detection function and refit the model
qqplot.ddf

Quantile-quantile plot and goodness of fit tests for detection functions
ptdata.single

Simulated single observer point count data
summary.ds

Summary of distance detection function model object
stake78

Wooden stake data from 1978 survey
test.breaks

Test validity for histogram breaks(cutpoints)
setbounds

Set parameter bounds
summary.io

Summary of distance detection function model object
summary.trial.fi

Summary of distance detection function model object
varn

Compute empirical variance of encounter rate
print.summary.rem

Print summary of distance detection function model object
summary.io.fi

Summary of distance detection function model object
summary.rem

Summary of distance detection function model object
setcov

Creates design matrix for covariates in detection function
summary.rem.fi

Summary of distance detection function model object
summary.trial

Summary of distance detection function model object
survey.region.dht

Extrapolate Horvitz-Thompson abundance estimates to entire surveyed region
setinitial.ds

Set initial values for detection function based on distance sampling
adj.check.order

Check order of adjustment terms
apex.gamma

Get the apex for a gamma detection function
AIC.ddf

Akaike's An Information Criterion for detection functions
assign.default.values

Assign default values to list elements that have not been already assigned
add.df.covar.line

Add covariate levels detection function plots
NCovered

Compute estimated abundance in covered (sampled) region
average.line

Average detection function line for plotting
average.line.cond

Average conditional detection function line for plotting
assign.par

Extraction and assignment of parameters to vector
book.tee.data

Golf tee data used in chapter 6 of Advanced Distance Sampling examples
create.bins

Create bins from a set of binned distances and a set of cutpoints.
DeltaMethod

Numeric Delta Method approximation for the variance-covariance matrix
coef.ds

Extract coefficients
check.bounds

Check parameters bounds during optimisations
calc.se.Np

Find se of average p and N
covered.region.dht

Covered region estimate of abundance from Horvitz-Thompson-like estimator
cdf.ds

Cumulative distribution function (cdf) for fitted distance sampling detection function
compute.Nht

Horvitz-Thompson estimates 1/p_i or s_i/p_i
cds

CDS function definition