Description Details SIMPLE BAYESIAN POSTERIORS OCCUPANCY DENSITY from spatial capture-recapture data ABUNDANCE from closed-population capture-recapture data SURVIVAL from capture-recapture data SPECIES RICHNESS from species x sample matrices BIODIVERSITY INDICES DATA SETS UTILITY FUNCTIONS Author(s)

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

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 `Bwiqid`

objects, a data frame with a column of MCMC observations for each parameter, plus attributes for MCMC diagnostics; there are `print`

, `summary`

and `plot`

methods.

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.

The functions are listed by topic below.

`Bbinomial` | generate draws from a conjugate beta posterior distribution |

`Bpoisson` | generate draws from a conjugate gamma posterior distribution |

`Bnormal` | fit a basic normal model to data |

**Single-season occupancy**

`occSS` | general-purpose ML function; allows site- and survey-specific covariates |

`BoccSS` | general-purpose Bayesian implementation of the above |

`occSS0` | a basic psi(.) p(.) model, faster if this is all you need |

`BoccSS0` | a Bayesian implementation of the psi(.) p(.) model |

`occSSrn` | Royle-Nichols method |

`occSStime` | faster if you have only time effects, also does a plot |

`occSScovSite` | faster if you only have site-specific covariates |

`occ2sps` | single-season two-species models |

**Multi-season occupancy**

`occMS` | general-purpose function; parameters depend on covariates; slow |

`occMScovSite` | smaller range of covariate options |

`occMS0` | a simple multi-season model with four parameters; faster |

`occMStime` | parameters vary by season; faster |

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

`Bsecr0` | a Bayesian implementation of the intercept-only model |

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

`closedCapM0` | simple model with constant capture probability |

`closedCapMb` | permanent behavioural response to first capture |

`closedCapMt` | capture probability varies with time |

`closedCapMtcov` | allows for time-varying covariates |

`closedCapMh2` | heterogeneity with 2-mixture model |

`closedCapMhJK` | jackknife estimator for heterogeneity |

**Cormack-Jolly-Seber models**

`survCJS` | model with time-varying covariates |

`BsurvCJS` | a Bayesian implementation of the above |

`survCJSaj` | allows for different survival for adults and juveniles |

**Pollock's robust design**

`survRDah` | 2-stage estimation of survival and recruitment |

`survRD` | single stage maximum likelihood estimation |

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

**Rarefaction**

`richRarefy` | Mao's tau estimator for rarefaction |

`richCurve` | a shell for plug-in estimators, for example... |

`richSobs` | the number of species observed |

`richSingle` | the number of singletons observed |

`richDouble` | the number of doubletons observed |

`richUnique` | the number of uniques observed |

`richDuplicate` | the number of duplicates observed |

**Coverage estimators**

`richACE` | Chao's Abundance-based Coverage Estimator |

`richICE` | Chao's Incidence-based Coverage Estimator |

`richChao1` | Chao1 estimator |

`richChao2` | Chao2 estimator |

`richJack1` | first-order jackknife estimator |

`richJack2` | second-order jackknife estimator |

`richJackA1` | abundance-based first-order jackknife estimator |

`richJackA2` | abundance-based second-order jackknife estimator |

`richBoot` | bootstrap estimator |

`richMM` | Michaelis-Menten estimator |

`richRenLau` | Rennolls and Laumonier's estimator |

**Alpha diversity**

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

`biodSimpson` | inverse of Simpson's index of dominance |

`biodShannon` | exponential form of Shannon's entropy |

`biodBerger` | inverse of Berger and Parker's index of dominance |

`biodBrillouin` | exponential 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.

`distBrayCurtis` | complement of Bray-Curtis index, aka 'quantitative Sorensen' |

`distChaoJaccCorr` | complement of Chao's Jaccard corrected index |

`distChaoJaccNaive` | complement of Chao's Jaccard naive index |

`distChaoSorCorr` | complement of Chao's Sorensen corrected index |

`distChaoSorNaive` | complement of Chao's Sorensen naive index |

`distChord` | distance between points on a normalised sphere |

`distJaccard` | complement of Jaccard's index of similarity |

`distMorisitaHorn` | complement of the Morisita-Horn index of similarity |

`distOchiai` | complement of the Ochiai coefficient of similarity |

`distPreston` | Preston's coefficient of faunal dissimilarity |

`distRogersTanimoto` | complement of the Rogers and Tanimoto's coefficient of similarity |

`distSimRatio` | complement of the similarity ratio |

`distSorensen` | complement of the Sorensen or Dice index of similarity |

`distWhittaker` | Whittaker's index of association |

`dippers` | Capture-recapture data for European dippers |

`distTestData` | artificial data set for distance measures |

`GrandSkinks` | multi-season occupancy data |

`KanhaTigers` | camera-trap data for tigers |

`KillarneyBirds` | abundance of birds in Irish woodlands |

`MeadowVoles` | mark-recapture data from a robust design study |

`railSims` | simulated detection/non-detection data for two species of rails |

`salamanders` | detection/non-detection data for salamanders |

`seedbank` | number of seeds germinating from samples of soil |

`Temburong` | counts of tree species in a 1ha plot in Brunei |

`TemburongBA` | basal area of tree species in a 1ha plot in Brunei |

`weta` | detection/non-detection data and covariates for weta |

`AICc` | AIC with small-sample correction |

`AICtable` | tabulate AIC for several models |

`allCombinations` | model formulae for combinations of covariates |

`plotPost` | graphic display of a posterior distribution |

`postPriorOverlap` | calculation and display of posterior/prior overlap |

`as.Bwiqid` | converts a range of classes of MCMC output to class `Bwiqid` so that `wiqid` 's print and plot functions can be used. |

`diagnostic plots` | trace, density, and auto-correlation plots for MCMC output. |

Mike Meredith

Maintainer: Mike Meredith <[email protected]>

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.