Learn R Programming

wiqid (version 0.3.3)

wiqid-package: Fast, simple estimation functions for wildlife population models

Description

Quick and dirty functions to estimate occupancy, survival, abundance, species richness and diversity, etc. for wildlife populations.

Arguments

SIMPLE BAYESIAN POSTERIORS

Bbinomialgenerate draws from a conjugate beta posterior distribution
Bpoissongenerate draws from a conjugate gamma posterior distribution
Bnormalfit a basic normal model to data

OCCUPANCY

Single-season occupancy

occSSgeneral-purpose ML function; allows site- and survey-specific covariates
BoccSSgeneral-purpose Bayesian implementation of the above
occSS0a basic psi(.) p(.) model, faster if this is all you need
BoccSS0a Bayesian implementation of the psi(.) p(.) model
occSSrnRoyle-Nichols method
occSStimefaster if you have only time effects, also does a plot
occSScovSitefaster if you only have site-specific covariates
occ2spssingle-season two-species models

Multi-season occupancy

occMSgeneral-purpose function; parameters depend on covariates; slow
occMScovSitesmaller range of covariate options
occMS0a simple multi-season model with four parameters; faster
occMStimeparameters vary by season; faster

DENSITY from spatial capture-recapture data

We use the secr package for ML estimation of density. For Bayesian estimation, wiqid offers:

Bsecr0a Bayesian implementation of the intercept-only model

ABUNDANCE from closed-population capture-recapture data

Although data for genuinely closed populations are rare, this is an important conceptual stepping-stone from CJS models to robust models for survival.

closedCapM0simple model with constant capture probability
closedCapMbpermanent behavioural response to first capture
closedCapMtcapture probability varies with time
closedCapMtcovallows for time-varying covariates
closedCapMh2heterogeneity with 2-mixture model
closedCapMhJKjackknife estimator for heterogeneity

SURVIVAL from capture-recapture data

Cormack-Jolly-Seber models

survCJSmodel with time-varying covariates
BsurvCJSa Bayesian implementation of the above
survCJSajallows for different survival for adults and juveniles

Pollock's robust design

survRDah2-stage estimation of survival and recruitment
survRDsingle stage maximum likelihood estimation

Note that the RD functions are preliminary attempts at coding these models and have not been fully tested or benchmarked.

SPECIES RICHNESS from species x sample matrices

Rarefaction

richRarefyMao's tau estimator for rarefaction
richCurvea shell for plug-in estimators, for example...
richSobsthe number of species observed
richSinglethe number of singletons observed
richDoublethe number of doubletons observed
richUniquethe number of uniques observed
richDuplicatethe number of duplicates observed

Coverage estimators

richACEChao's Abundance-based Coverage Estimator
richICEChao's Incidence-based Coverage Estimator
richChao1Chao1 estimator
richChao2Chao2 estimator
richJack1first-order jackknife estimator
richJack2second-order jackknife estimator
richJackA1abundance-based first-order jackknife estimator
richJackA2abundance-based second-order jackknife estimator
richBootbootstrap estimator
richMMMichaelis-Menten estimator
richRenLauRennolls and Laumonier's estimator

BIODIVERSITY INDICES

Alpha diversity

All of these functions express diversity as the number of common species in the assemblage.

biodSimpsoninverse of Simpson's index of dominance
biodShannonexponential form of Shannon's entropy
biodBergerinverse of Berger and Parker's index of dominance
biodBrillouinexponential form of Brillouin's index

Beta diversity / distance

All of these functions produce distance measures (not similarity) on a scale of 0 to 1. The function distShell provides a wrapper to produce a matrix of distance measures across a number of sites.

distBrayCurtiscomplement of Bray-Curtis index, aka 'quantitative Sorensen'
distChaoJaccCorrcomplement of Chao's Jaccard corrected index
distChaoJaccNaivecomplement of Chao's Jaccard naive index
distChaoSorCorrcomplement of Chao's Sorensen corrected index
distChaoSorNaivecomplement of Chao's Sorensen naive index
distChorddistance between points on a normalised sphere
distJaccardcomplement of Jaccard's index of similarity
distMorisitaHorncomplement of the Morisita-Horn index of similarity
distOchiaicomplement of the Ochiai coefficient of similarity
distPrestonPreston's coefficient of faunal dissimilarity
distRogersTanimotocomplement of the Rogers and Tanimoto's coefficient of similarity
distSimRatiocomplement of the similarity ratio
distSorensencomplement of the Sorensen or Dice index of similarity
distWhittakerWhittaker's index of association

DATA SETS

dippersCapture-recapture data for European dippers
distTestDataartificial data set for distance measures
GrandSkinksmulti-season occupancy data
KanhaTigerscamera-trap data for tigers
KillarneyBirdsabundance of birds in Irish woodlands
MeadowVolesmark-recapture data from a robust design study
railSimssimulated detection/non-detection data for two species of rails
salamandersdetection/non-detection data for salamanders
seedbanknumber of seeds germinating from samples of soil
Temburongcounts of tree species in a 1ha plot in Brunei
TemburongBAbasal area of tree species in a 1ha plot in Brunei
wetadetection/non-detection data and covariates for weta

DISTRIBUTIONS

These are convenience wrappers for the related d/p/q/r functions in the stats package which allow for parameterisation with mean and sd or (for Beta) mode and concentration.

dbeta2 etcBeta distribution with mean and sd
dbeta3 etcBeta distribution with mode and concentration
dgamma2 etcGamma distribution with mean and sd
dt2 etct-distribution with location, scale and df parameters
dt3 etct-distribution with mean, sd and df parameters

UTILITY FUNCTIONS

AICcAIC with small-sample correction
AICtabletabulate AIC for several models
allCombinationsmodel formulae for combinations of covariates
standardizea simple alternative to scale.

Author

Mike Meredith

Details

There are a number of sophisticated programs for the analysis of wildlife data, producing estimates of occupancy, survival, abundance, or density. wiqid began as a collection of fast, bare-bones functions which can be run from R suitable for use when you are generating hundreds of simulated data sets. The package takes its name from the quick-and-dirty nature of the original functions.

We now use wiqid in basic wildlife study design and data analysis workshops, and most functions now have options to check the input data and give informative error messages. Workshop participants have used lm, glm and functions in the secr and BEST packages. So wiqid tries to match the look and feel of these functions.

All functions use standard data frames or matrices for data input. ML estimation functions return objects of class wiqid with parameter estimates on the transformed scale (usually logit functions), variance-covariance matrix, and back-transformed `real' values; there are print, logLik and predict methods. Bayesian functions (distinguished by an initial "B") return class mcmcOutput objects.

Simulations and bootstraps often generate weird data sets, eg. capture histories with no captures. These functions do not throw errors or give warnings if the data are weird, but return NAs if estimates cannot be calculated. Errors may still occur if the data are impossible, eg. 6 detections in 5 occasions.

Note that in version 0.2.0 the scaling of continuous covariates has changed to SD=1 (previously SD=0.5). This means that beta coefficients will now be exactly half the size, matching the output from other software.

The functions are listed by topic below.