Introduction

Wood thrush DENSITY 5.0

Copyright (C) 2007-2012 Murray Efford

Program DENSITY is a Windows application
for spatially explicit capture–recapture (SECR).

www.otago.ac.nz/density
www.phidot.org/forum

This software is provided free and without warranty
under the GNU General Public License Version 2.

Help file last modified 7 December 2012
DENSITY 5.0 implements methods for estimating the density of animal populations from capture-recapture data collected using an array of 'detectors'. Detectors may be live-capture traps, with animals uniquely marked; they also may be sticky traps or snags that passively sample hair, from which individuals are distinguished by their DNA microsatellites, or cameras that take photographs from which individuals are recognized by their natural marks.

Spatially explicit capture-recapture fits a spatial model of the detection process to capture-recapture data that include the locations where each animal is detected. Estimates of population density and population size are unbiased by edge effects and incomplete detection. Maximum likelihood is the preferred method for fitting a spatial detection model (Borchers & Efford 2008). DENSITY also provides:
  • plots of spatial capture-recapture data
  • SECR model fitting by the older 'inverse prediction' method (Efford 2004)
  • a simulator for spatial capture-recapture sampling
  • a tool for designing arrays of traps or other detectors
  • conventional estimation of density by the boundary-strip method
  • simple non-spatial and open-population analyses.
DENSITY 5.0 includes an interface to the R package secr that has many additional features. For other changes in the current version click here.


Getting started

Getting started with DENSITY

DENSITY consists of the executable density5.exe and the compiled help file density5.chm. Place these files in the same folder. A separate 'working directory' may be used for data and output (see Options | General). The interface is like other Windows programs. Right-click on controls for local options.

Default data files are provided (trap layout in traps.txt, capture data in capt.txt). Click on 'Read data' to load these. Capture files may contain data from more than one primary session; captures from all the sessions are read into memory. A report on trap locations and the closed-population estimates is written to the log file (default density5.log, see 'View log' button).

TIP: 'Read data' is the first step in any analysis.

For closed-population analyses, one primary session is analyzed at a time. The current session is shown in the 'Session selector' window; click the arrows to change it at any time. Statistics for the current session are displayed under the 'Population', 'Summary' and 'Movements' tabs. These change automatically to reflect the current session and choice of estimator. Choose an appropriate population estimator from the dropdown menu.

To estimate density, tick either IP (simulation and inverse prediction) or ML (maximum likelihood estimation) and click GO or GO All. A 'search progress' box will appear and the solution will be posted there if the search is successful. A running report is also added to the log, and output is appended to the output text file (default density5.out, see 'View output' button). For ML estimation of density, the log has the most complete results. You may need to vary the settings for IP or ML in Options.

See also Data requirements, Main screen, Examples, Options


Density main form

DENSITY 5 main screen

main form
* Appears only after 'Read data'

Main menu, Tool buttons, Trap layout, Capture data, Map, Status bar, Session statistics, Analysis groups, Brushtail possum example


Trap Builder

Use Trap Builder to create a text file with X-Y coordinates defining a trap layout. This trap layout may then be used for DENSITY analyses (main screen) and in simulations (Simulator).

Traps are located by specifying the layout type (one trap, line, grid, web, transect, from file), trap spacing and other variables specific to each possible layout. 'Web' refers to a trapping web after Anderson et al. (1983).

First click the 'Place traps' tool button. This displays a map of trap locations that changes as you change the settings. The x-y coordinates of the current placement appear under the Trap coordinates tab; for a permanent record use the 'Save' tool button. Initially the layout is centred on (0, 0), but you can shift this if you want (change takes effect when you repeat 'Place traps').

Trap Builder is very much 'what you see is what you get', and not all features will be documented. The maximum number of trap locations is arbitrarily large (1000000); in the rest of DENSITY there is a much lower limit on the number of sites in a trap layout (see program limits).

Trap display options

Display options appear on a popup menu when you right-click on the map. 'Show polygon(s) as overlay' uses the polygon file for display only.

Randomly placed groups of traps

The centre points (grids, webs) or starting points (lines) of random units are placed by default within a square area. 'Bounding square' specifies its size in metres. Alternatively, random sites may be restricted to a user-defined polygon. 'Minimum separation' prevents any traps from different lines, webs or grids being closer than the specified tolerance.

Input from file

Trap locations may be input from a DENSITY trap file, rather than using one of the standard geometries (point, line, grid, web). You may use all sites in the file, or a random subsample. The random subsample may be

  • a simple random sample of exactly K sites. The sample is selected by drawing a uniform random number for each site and selecting the K sites with the largest random value.
  • a spatially balanced random sample of exactly K sites (GRTS). details
  • a binomial probability sample of sites. The sample is selected by drawing a uniform random number U between 0 and 1 for each site and selecting the sites with U < p where p is the probability of inclusion.

Other settings

'Display buffer' surrounds the traps (or the square area in the case of random units) with a border of the chosen width. This has no significance for any calculations or for the output coordinates.

The 'ruler' is used to measure distances between traps and enclosed areas. In 'Simple' mode just click and drag. The ruler snaps to the nearest trap. In 'Polyline' mode, the user clicks on or near a starting trap, and then in sequence near other traps to define a route and an enclosed area. Results are displayed on the status bar. Click 'Reset' to start a new route when in Polyline mode.

'Shift' gives the user control over the origin of the coordinate system (see also 'Shift origin to cursor position' on the popup menu)

'Snap to' merely determines the rounding of the location displayed as the mouse moves over the trap display.

TIP: Take note of how traps are labelled. Details like leading zeros are important because site identifiers in the 'trap layout' and 'capture data' files must match exactly when you 'Read data' in DENSITY.
TIP: Remember the popup menu (right-click on map)
TIP: If you vary the font of trap labels be sure to choose a colour other than the background colour.
TIP: If the traps disappear, try 'Place traps' again, or unticking the 'flip vertically' box, or unticking Random units 'On'


DENSITY project files

Project files are an optional feature of DENSITY. By saving all settings in a project file you can easily repeat an analysis with new data or tweak the settings. Project files are saved in a text format.

Open project files from the File menu. To save all current settings to a new file, click File | SaveAs. Retrieve these settings by clicking File | Open. Project files have the extension '.den'. By default, opening a project file also causes the data to be read (as with 'Read data'), but this step can be suppressed (see Options | General).

A DENSITY project file may be opened from the command line, e.g.
density5 myanalysis.den

You can associate density5.exe with files of the extension '.den' (see the Help for 'Open with...' in your version of Windows). Clicking on a shortcut to a DENSITY project file (or on the file name in Windows Explorer etc.) will then open it in DENSITY.

Settings for simulation (Power analysis) are saved separately in files with the extension .dpa (see the Power analysis File menu). 'Options' settings are used for both data analysis and simulation; they are saved in both .den and .dpa files.


Output

Some DENSITY results are displayed on the screen, but most are saved to one of two text files – the log file or the output file. The log file maintains a running record of each session, and also receives important output from ML SECR. Over multiple analyses it can become large and should be editted to remove unwanted material.

Output from analyses, including IP SECR or ML SECR estimates of density and other parameters, is appended to the output file. The format of the output file is tabular; so long as you remember to skip header and footer lines it may be read directly into a package such as R or S-Plus. Cutting and pasting to a spreadsheet is easier if you use the 'Tab delimited' setting.

See also an examples of IP SECR output (from a previous version, but not much has changed) and ML SECR output to the log file.


Tips on usage

General tips on usage

Input

 You can view an input text file by double-clicking on its filename box. (e.g. in the Trap layout or Capture data panels). Double-clicking outside the filename box in the Trap layout panel previews the trap layout.

When multiple trap files are used to associate a separate trap layout with each session there is a high potential for error. The first file is for the first session, the second file for the second session etc. If a trap layout file is missing from the list then a mismatch is likely to occur. This may result in the error message:

Capture file contains record of ID XXX in session YYY at site with trapID ZZZ (occasion TTT) that is not in trap site file FFF, or trap was not set.

Pxy

Contours of Pxy and other calculations on Pxy are conditional on the values of g0 and σ displayed in the 'Demonstration parameters' box. They are independent of density.

The plot of Pxy is not cumulative. To plot the average Pxy across all animals within a Pxy contour, use Tools | Export Pxy and form the average in a spreadsheet or stats program.

Output fields

Selecting output fields - Output fields are selected differently for analyses via the main screen and in the Simulator:

  • For ordinary analyses see Options | Output.
  • For simulations use the 'Select fields' button on the 'Simulator' form.
See also: SECR troubleshooting, FAQ


FAQ

DENSITY 5.0 Frequently asked questions

  1. How many captures and recaptures do I need to use DENSITY?
    It is most critical to get enough recaptures. To estimate density by SECR you will probably need at least 10 recaptures, and 20 is a safer minimum. AIM FOR MANY MORE THAN THE MINIMUM! Precision improves rapidly with additional recaptures, with slowly diminishing returns over 50 or so (e.g. Efford, Dawson & Robbins 2004 Fig. 2). Some studies have many recaptures of few animals (<20 individuals); estimation is possible, but confidence intervals will be very wide. To fit more complicated models with covariates, finite mixtures, trends etc. you will need more data.
  2. I cannot open the help file. What is wrong?
    First check that there is a file Density5.chm in the folder with Density5.exe. Density5.chm is a compiled Windows help file, created with the Microsoft HTML help compiler version 4.74. It is seen by the operating system as an executable file, and treated by some systems as a security risk. This is the most likely cause of your problem. Try opening the help file from Windows Explorer and overriding any security warning. If you downloaded a 'naked' version of the help file then right-click on it, select Properties, click Unblock and Apply.
  3. Should I use R?
    Almost certainly, yes. The R package     secr greatly extends DENSITY. Many more models can be fitted, and fits may easily be compared by AIC. Spatial variation in density may be related to habitat variables. Model averaging is enabled. Complex sequences of data manipulation and analysis may be prepared as R scripts. R can be impenetrable on first encounter, so we provide the R interface in DENSITY as a bridge. The interface can translate most of what you have been doing in DENSITY into R code. This excludes simulation, for which the DENSITY Simulator is probably more powerful.
  4. What about Bayesian methods?
    Andy Royle and collaborators have recently shown how data augmentation and Markov chain Monte Carlo methods may be used to fit some SECR models (e.g., Royle & Young (2008) Ecology 89: 2281-2289; see also Marques et al. (2011) and Efford (2011)). So far, these are largely a subset of what is available in DENSITY and 'secr', but the approach has potential advantages for modelling random effects. Sceptics will note the challenge of model selection. Bayesian methods perform no better than the methods in DENSITY and can be much slower.
  5. Why are the confidence intervals for estimated density so wide?
    Perhaps you don't have enough data. More constructively: What is the basis for your comparison? If you are tempted to use N-hat/A-hat, make sure you include uncertainty in A-hat as well as N-hat (see Calculator on 'ETA density tab'). Also, the default intervals reported from IP SECR and ML SECR are for the expected population density; that is, they include spatial process variation in population density that is 'conditioned out' of conventional ETA estimates (N-hat/A) (but not estimates by conventional distance sampling). There are three ways to get more comparable intervals from SECR (i) in Options | ML SECR set Distribution to Binomial, (ii) use an estimate of the precision of realised population size from Efford and Fewster (2012; see also 'secr' function region.N) or (iii) from IP SECR use the Adjusted SE (see Help index). And remember that your estimate of N-hat will have spurious precision if it does not model individual heterogeneity due to home range location - this is automatic in SECR.
  6. The font in the Help file looks heavy and blurry. What can I do?
    Open Internet Explorer and under Tools | Internet Options | Advanced | Multimedia     switch off 'Always use Clear Type for HTML'. (Windows uses IE when displaying .chm files)
  7. Can I pool data from different grids?
    Yes. Set up the capture file with the data for each grid as a separate 'session'. In ML SECR pooling is achieved by defining a 'between-sessions' model in which a parameter is constant across sessions. For example, a single detection parameter may be fitted across multiple grids. There is no facility for estimating empirical (between-grids) encounter rate variance. For IP SECR, the same trap layout must be used for each session. Use a Session filter such as [1-3] to produce a combined estimate. Usually you will want to use Options | Input 'Separate ID each pooled session' and Options | Output 'Re-scale density from pooled sessions' (both of these are on by default).
  8. Can I manipulate the design matrix, as in MARK?
    No. DENSITY packages the ML SECR models you are likely to need so that you don't have to wrestle with design matrices. You define models in DENSITY mostly by clicking options and entering covariates. The open-ended style of MARK (and RMark) is very attractive, but we felt that novice SECR users needed a tighter and more prescriptive approach. A much more extensive model set is available in the R package secr; the R interface provided in DENSITY 5.0 should get you started.
  9. How can I run CAPTURE?
    First you need the program - you can get it from the Patuxent software archive maintained by Jim Hines. In 'Options | Closed N' browse to the location of the CAPTURE executabl and download it to the folder with Density5.exe. Now you can run CAPTURE from the CAPTURE tabbed page on the right of the main screen (assuming you have loaded some data). Right-click on the task window to select tasks from a popup menu. Be warned that CAPTURE can choke on very long file names, and there is a limit on the number of animals (at least in the Patuxent version).
  10. How should I be guided by the model selection algorithm in CAPTURE?
    For non-spatial analyses you should be aware that the algorithm lacks power and may mislead when data are sparse. For spatial analyses (IP SECR or ML SECR) there is the added complication that the tests in CAPTURE assess individual heterogeneity caused by animal location as a violation of the null model, while the spatial 'null' model expects this heterogeneity and allows for it. Nevertheless, test results from CAPTURE showing a strong learned trap response should be taken seriously.
  11. Why does the program sometimes lock up?
    I don't know. The interface has a few low-priority bugs that surface mostly when exotic (over-ambitious) models are fitted to small datasets. Please report and move on :-). Ctrl-Alt-Del will bring up the Windows task manager so you can end the Density process. Count to ten and remember what you paid for it...
  12. Can I display trap sites overlaid on a GIS layer (raster map)?
    Yes. See 'Background image' in the help index.
  13. What scale limitations are there in DENSITY?
    In principle, none. In practice, the interface works best for trap spacings in whole metres.
  14. How should I cite DENSITY?
    The recommended citation for the present version of the software is
    Efford MG 2012. Density 5.0: software for spatially explicit capture-recapture. Department of Mathematics and Statistics, University of Otago, Dunedin, New Zealand. http://www.otago.ac.nz/density.
    Citations for specific SECR methods are in the References (see the Publications page on the website for the latest).
References


Data requirements

DENSITY generally requires two text files specifying the trap locations* and the capture events. Prepare these input files with a text editor, or export them from your database software. Spaces, commas or tabs may be used between values. Lines that start with a comment symbol ';' or '#' will be ignored.

Trap locations
Capture events

DENSITY places limits on the number of traps, the number of occasions etc. These may change from version to version.

* Trap locations are not required for non-spatial data.


Trap layout file

Each line of the trap layout file has the format: TrapID X-coordinate Y-coordinate, e.g.
A1  2674860   5982600
B1  2674890   5982600
C1  2674920   5982600
D1  2674950   5982600
etc.

TrapID is a string of up to 17 characters. Any cartesian coordinate system, global or local, may be used. It is assumed that the same projection is used throughout.

No restriction is placed on trap layout (traps need not be on a grid), although some layouts may be unsuitable for SECR (for example, if traps are so widely separated that recaptures are always at the site of first capture).

TIP: If the geometry of your layout is simple (e.g. a rectangular grid) then it is easy to generate a trap layout file with Trap builder . Input of coordinates (e.g. UTM coordinates from GPS) from a file is useful if your layout is irregular or if you want to use a georeferenced base image.

WARNING: Coordinates must be on a rectangular grid. Unprojected latitude and longitude are unsuitable. The free conversion software DNRGPS (previously DNRGarmin) is highly recommended.

See also Detector type, Incomplete trap layouts, Covariates, Trap covariates


Capture data box

Capture data

Capture data are read from a single text file of capture records, one per line. Each capture record includes at least a session identifier, an animal identifier, and an occasion number.

Capture data may be in any of four formats (select one from the drop-down box on the main screen):

  • Non-spatial – capture locations not needed (ignored if included)
  • TrapID format – capture locations given by a code for the trap site
  • XY format – capture locations given as full X-Y coordinates

A negative occasion number is used to indicate loss on capture.
Capture data may be modified by temporary filters that are applied on input ('Read data').
The capture file may also include individual covariates as additonal fields at the end of each capture record.


Capture file - nonspatial format

Capture file – non-spatial format

Each line of a non-spatial capture file has the format: SessionID AnimalID Occasion
e.g.
4 292 5  )   5 captures of animal 292 on occasions 2, 3, 5 and 8 of
1 292 2  )   sessions 1, 4,  and 5
5 292 2  )
1 292 8  )
4 292 3  )
5 350 5
1 358 3
etc

TIP: Non-spatial input can be used only for certain non-spatial analyses, and particularly excludes density estimation by inverse prediction, maximum likelihood or distance analysis.

We use 'Session' for a primary session of Pollock's (1982) 'robust' design, and 'Occasion' for a secondary session. DENSITY analyses are conducted independently on each primary session, but because field studies often comprise several primary sessions, DENSITY allows for input from multiple sessions. DENSITY sorts the input by session before analysis. Duplicate records are ignored.

SessionID and AnimalID may be strings of up to 17 letters, digits or other characters excluding delimiters.
DENSITY is not case-sensitive.


Capture file - TrapID format

Capture file – TrapID format

Each line of a TrapID capture file has the format: SessionID AnimalID Occasion TrapID,
e.g.
4 292 5 A5
1 292 2 B3
5 292 2 F1
1 292 8 F5
4 292 3 F5
5 350 5 G2
1 358 3 G3
etc.

We use 'Session' for a primary session of Pollock's (1982) 'robust' design, and 'Occasion' for a secondary session more. DENSITY analyses are conducted independently on each primary session, but because field studies often comprise several primary sessions, DENSITY allows for input from multiple sessions. DENSITY sorts the input by session before analysis. Duplicate records are ignored unless the detector type is set to 'Proximity' or 'Allow recaptures within an occasion' is selected in Options | Input.

SessionID and AnimalID may be strings of up to 17 letters, digits or other characters excluding delimiters. DENSITY is not case-sensitive.

See also Covariates, Individual covariates


Capture file - XY format

Capture file – XY format

Each line of an XY capture file has the format: SessionID AnimalID Occasion X-coordinate Y-coordinate,
e.g.
1 292  2 2675040 5982720  ) 5 captures of animal 292 on occasions 2, 3, 5 and 8
1 292  8 2675070 5982810  ) of sessions 1, 4,  and 5. Animal not released
4 292  5 2675010 5982780  ) on last capture.
4 292  3 2675070 5982810  )
5 292 -2 2675070 5982780  )
5 350  5 2675070 5982720
1 358  3 2674950 5982810
etc

X- and Y-coordinates should be in metres; they need not be integers. Except for the use of a negative occasion number to indicate losses on capture, this format is compatible with the XY format used by Program CAPTURE (Otis et al. 1978). Fixed-format data prepared for CAPTURE will work in DENSITY, so long as they are prefixed by a Session field that is skipped in the CAPTURE Fortran format specification (e.g. (1X, A4, F3.0, F8.0, F8.0) in this example).

TIP: Capture sites are a subset of trap sites in the trap layout file (X-Y coordinates should match exactly). TrapID format is usually simpler to use.

We use 'Session' for a primary session of Pollock's (1982) 'robust' design, and 'Occasion' for a secondary session. DENSITY analyses are conducted independently on each primary session, but because field studies often comprise several primary sessions, DENSITY allows for input from multiple sessions. DENSITY sorts the input by session before analysis. Duplicate records are ignored unless the detector type is set to 'Proximity' or 'Allow recaptures within an occasion' is selected in Options | Input.

SessionID and AnimalID may be strings of up to 17 letters, digits or other characters excluding delimiters. DENSITY is not case-sensitive.

See also Covariates, Individual covariates


Covariates

Some analyses optionally use ancillary data (covariates) provided by the user. Covariates must be numeric, except for 'Session factor' session covariates which may be alphanumeric.

Covariate | Description | Input method
Trap | Characteristic of trap or trap site | Append to each line in 'trap layout' file (details)
Individual | Persistent individual differences (e.g. sex, body size) | Append to lines of 'capture data' file (details)
Occasion | Characteristic of sampling time | Screen forms in Options | ML SECR & Options | Closed N | Huggins
Session | Characteristic of session | Session covariate form in Options | ML SECR (between-session tab)

Radiotelemetry data (e.g. the proportion of fixes within the convex hull of the traps) are special individual-level covariates, and are appended to the capture records like other individual covariates.

Another special individual-level covariate is generated automatically from the input capture data. This is the mean distance of an individual's capture locations from the bounding polygon (convex hull) of the traps. If selected in Options | Input, this covariate is available for inclusion in linear-logistic (Huggins / Alho) closed-population models.

Trap, individual and occasion covariates are standardised to mean = 0 and SD = 1.0 across all sessions. Prior to DENSITY 5.0 this standardisation used the within-session mean and SD; this may have resulted in misleading results when a between-session model was fitted because each session potentially used a different scaling.

TIP: Covariates cannot be used for IP SECR.


Estimating density by SECR

Estimating density by spatially explicit capture-recapture

Spatially explicit capture-recapture (Borchers and Efford 2008) deals with observations at an array of detectors (traps) that may be summarised as spatial encounter histories like this:
             Occasion
ID     1    2    3    4    5
 1    A9    .    .    .    .
 2   A12  A12    .    .    .
 3     .    .   C6   B5    .
 4     .    .   G3    .   F3
...

'ID' refers to individual animals, and entries in the body of the table correspond to known locations (trap sites). Spatial encounter histories from proximity detectors (hair snags, cameras etc.) may include multiple observations of an individual on one occasion.

Such data (derived from the usual DENSITY input files) allow us to fit a probability model with two main parts:

  • the distribution of the animals or, more specifically, the distribution of points (xi, yi) (loosely, the home range centre of animal i)
  • a function for the probability of capture in a trap as a function of the distance from (xi, yi) to the trap.
The home-range centres (xi, yi) are unknown, and there are probably too many animals and too few data to estimate (xi, yi) for each one. We proceed by assuming the centres follow a known 2-D distribution (e.g. Poisson) with density D. The minimum detection function parameters are usually g0 (intercept) and σ (spatial scale). DENSITY offers two methods for fitting the model:

ML SECR

For many models (but not for single-catch traps) we can write an explicit expression for the likelihood of the parameters given the data. This must include an integration over the (unknown) possible locations of each animal. We maximise the likelihood numerically to estimate density and the parameters of the detection function .

ML SECR models may be selected from a rich set of possibilities on the Options | ML SECR page. For a wider range of models see the R package 'secr'.

IP SECR

Simulation and inverse prediction is an alternative method for numerically fitting an SECR model to estimate density and the spatial detection function given georeferenced trapping data (more). Multiple simulations of trap sampling are done at selected points in the 3-D parameter space. Simulations form a designed experiment. At each iteration a linear model is fitted and inverted to estimate the desired parameters from the input data. The location of the design is adjusted and further simulations conducted until the estimated point is spanned by the design. The first design is centred on initial parameter values that are either provided by the user or calculated with an automatic algorithm. The size of the design and the number of replicate simulations may also be varied (IP SECR - Design).

Population size

DENSITY is not just for density. See here for estimation of population size from SECR models.

TIP: For many purposes, inverse prediction (IP SECR) has been superceded by maximum likelihood estimation (ML SECR) which allows greater flexibility in model selection. IP SECR is still the only way formally to fit models for data from single-catch traps, although estimates of density from ML SECR models applied to single-catch traps appear to be unbiased (Efford et al. 2009).

See also output, Troubleshooting


Assumptions

Assumptions of SECR

. These assumptions are largely shared by different methods for fitting SECR models (IP SECR, ML SECR etc.)

  1. The population is closed (i.e. there are no births, deaths or dispersal events during a trapping session).

  2. Capture does not affect the pattern of movement of an animal within a trapping session.

  3. Tags are not lost, and the identity and location of each recaptured animal is recorded accurately.

  4. Traps are set at known locations for a fixed time.

  5. Trap placement is random with respect to the location of animal ranges, and ranges are oriented at random.

  6. Animals occupy home ranges that do not change during a trapping session

  7. Home ranges are similar in size between animals.

  8. Home-range centres are scattered throughout the area sampled, or home-range centres are scattered within a mapped subset of the landscape (i.e. habitat areas in the mask).

TIP Some assumptions, especially (2), (7) and (8) are relaxed in specific extensions of the basic model


ML SECR models - overview

This chart summarises the ML SECR models in DENSITY 5.

Setting | Parameter(s) | Options | Default
Likelihood |  | Full or Conditional | Full
Detection function |  | Halfnormal, hazard or exponential | Halfnormal
Distribution model | D (density) | Poisson or Binomial | Poisson
Within-session model | g0, σ* | Time covariate t | g0[.] σ[.] (null model)
 |  | Response to capture b
 |  | Individual heterogeneity h, finite mixture
 |  | Individual heterogeneity h, covariates §
 |  | Trap effect k
Between-sessions model | ALL | Constant over sessions | D : session-specific g0, σ : constant
 |  | Session-specific
 |  | Linear trend
 |  | Linear function of session covariates
 |  | Session factor (arbitrary grouping of sessions)

* The hazard detection function has an additional primary parameter z that is assumed constant within sessions.
§ Conditional likelihood only.

See also Options | ML SECR, ML SECR within-session model, ML SECR between-session model


Example output

Example of ML SECR output

This example uses the default input files. I dropped a lot of output fields in Options | Output and selected the 'Stacked' option to reduce page width. See also the tips below.

ML SECR output example

TIP: The warning is only a problem if we care about the absolute value of g0; the estimates of density and sigma are remarkably robust to this model misspecification (see e.g. Efford, Borchers and Byrom 2009).

TIP: All detectors were used on all occasions. The number might fluctuate if we had specified Options | Input - Incomplete trap layout and coded the trap file accordingly.

References


ML SECR sources

ML SECR documentation

Likelihood-based spatially explicit capture-recapture is addressed in these papers and unpublished reports. Some methods are implemented only in the R package 'secr' (particularly area search, population size estimation and acoustic methods).

Borchers DL, Efford MG 2008. Spatially explicit maximum likelihood methods for capture–recapture studies. Biometrics (2008) 64: 377–385 | General theory for homogeneous and inhomogeneous Poisson processes and multi-catch detectors. Multi-year red-eyed vireo example.
Borchers DL, Efford MG 2007. Supplements to Biometrics paper. Available online at www.otago.ac.nz/density | Technical addendum to Borchers & Efford 2008: parameterisation, variance of density from conditional MLE, saturated likelihood for binomial model, bootstrap variance etc.
Efford MG, Borchers DL, Byrom AE 2009. Density estimation by spatially explicit capture–recapture: likelihood-based methods. Pp. 255–269. In: DL Thomson, EG Cooch, MJ Conroy (eds) Modeling Demographic Processes in Marked Populations. Springer | Restatement of SECR theory. Extension to proximity detectors (camera traps and passive DNA samples). Simulation of bias from trap saturation when detectors are single-catch traps. Stoat hair DNA example.
Efford MG, Dawson DK, Borchers, DL 2009. Population density estimated from locations of individuals on a passive detector array. Ecology 90: 2676–2682. | Focus on single-interval data for proximity detectors and new detector types
Efford MG 2011. Estimation of population density by spatially explicit capture-recapture analysis of data from area searches. Ecology 92: 2202–2207 | Includes comment on Royle and Young 2008
Efford MG, Fewster RM 2012. Estimating population size by spatially explicit capture-recapture. Oikos http://dx.doi.org/10.1111/j.1600-0706.2012.20440.x | Estimating population size, robustness to spatial variation in density
Efford MG 2012. DENSITY 5.0: software for spatially explicit capture–recapture. Department of Mathematics and Statistics, University of Otago, Dunedin, New Zealand. http://www.otago.ac.nz/density. | Windows compiled help file packaged with software.

Papers on IP SECR are also relevant (Efford 2004; Efford, Dawson and Robbins 2004; Efford et al. 2005).

References


Troubleshooting

SECR – Troubleshooting

Problems are often caused by sparse data (number of recaptures less than 20). The algorithms are less robust with small samples; you may get an estimate of density, but it will have wide confidence limits. The immediate reason is usually a lack of recaptures in either the raw data (all methods) or too few simulations (IP SECR).

  1. Check the data. Display the recaptures of individuals using 'show tracks' (see trap map) and especially check any extreme movements. You can temporarily exclude doubtful captures by placing a comment code (';') at the start of the offending line in the capture file (remember to save the file and re-load the data with 'Read data').
  2. Start with simple models and progress to others only if there is a clear reason.
  3. Check the initial value settings are reasonable (e.g. initial sigma about 1/3 home-range radius); use Manual initial values if necessary.
  4. Check for major breaches of assumptions.
  5. For ML SECR, try conditional likelihood instead of full likelihood in Options | ML SECR. This seems noticeably more robust.
  6. For IP SECR
    • increase 'maximum replicates per vertex' and increase required precision by reducing the threshold CV for each vertex (More replicates means less noise in the linear model from which the estimates are interpolated). Check 'Simulations per vertex' in the Log. DENSITY stops adding simulations at the maximum even if the required CV has not been reached. If the number of replicates generally equals the maximum, then the required CV is not being reached. This is unlikely to be the main problem.
    • Increase the size of the search box (too narrow a span also leads to poor extrapolation beyond the box, especially when the true surface is highly non-linear).
    • Change the detection function from half-normal to uniform. Detection probability g then takes the constant value g0 within the home range perimeter and is zero beyond σ metres from the centre.
    • Using a Buffer width that is too small may cause errors when calculating automatic initial values for inverse prediction if the buffer width is narrower than the strip width AND the polygon method is 'concave' (the message 'Exceeded iterations in quickplaceanimals' appears). Enlarge the buffer in the 'Trap layout' box.
  7. If the buffer width is too small, DENSITY may also fail to find a solution without reporting any other error.The pool of animals at risk of capture is truncated at the buffer as if all sites beyond the buffer were non-habitat. It is up to the user to determine a buffer width that is large enough to encompass the population at risk of capture. With an over-sized buffer in IP SECR the simulations will take a little (or a lot) longer. A grossly over-sized buffer in ML SECR usually entials a coarse integration mesh, which has unpredictable effects on the estimates. Check with Tools | ML SECR log likelihood.


Options

These pages control most of what DENSITY does, both on the main analysis form and in the Simulator (Trap Builder is independent).
Page* | Content
General | Working directory, random seed, .den options
Input | Variations on standard input formats
Output | Output file names, area units, selection of output fields etc.
Graphics | Drawing colours, background image and related settings
Computation | Settings for numerical integration, likelihood maximisation and automatic initial values
Habitat mask | Mask file name, attributes and preview
Closed N | Closed population estimation, linear-logistic models, radiotelemetry
IP SECR | Spatially explicit capture-recapture by simulation and inverse prediction
ML SECR | Likelihood-based spatially explicit capture-recapture; within- and between-session models
Open population | Jolly-Seber, Cormack-Jolly-Seber (CJS) and reversed CJS models
Simulator | Output file names, open population, radiotelemetry
R interface | R task translator and batch interface
* Background highlighting indicates the pages used most often.


Options General

Options | General

Working directory
Random seed
Density project file


Options Input

Options | Input

Trap layout
Allow multiple trap files
Incomplete trap layout
Buffer spin increment

Capture data
Number of occasions per session
No tag code
No tag prefix
Separate ID
Allow recaptures within occasion

Auto covariate
Compute distance to trap bounding polygon

Trap-revealed movement
Minimum N recaptures


Options Output

Options | Output

Title (annotation for output file)
Log file name
Output file name (for estimates)

Units of area
Output style
Optional statistics

Closed-N confidence intervals
 Confidence level %
Missing value code
 'No capture' code
Debug message level

Verify before execution
Beep on completion
Auto legend
 Tab delimited
Re-scale density from pooled sessions

Fields in output


Graphics

Options | Graphics

Drawing colours details
Drawing options
Fill style
Occasion split
Grid line spacing
Miscellaneous
ETA perimeter points per trap
Number of points on ellipse
Background image details
File name
Edge coordinates
Pictures
Contour settings
TIP: The contour interval for a particular plot is not set here. Instead, right-click on contour plot and select the 'Contour interval' item from the popup menu. A box will appear in which you can enter a new interval.


Computation

Options | Computation

2-D numerical integration
Likelihood maximisation
Automatic initial values
 Correction for edge effect (toroidal wrapping)


Options Habitat mask

Options | Habitat mask

Select a habitat mask file for a vector habitat mask to be used throughout DENSITY and especially for IP SECR and ML SECR. A mask takes effect only when it is switched on (note radiobutton below), although a preview is available immediately a valid mask file has been named.
  • The polygons in a mask file may represent either habitat or non-habitat areas.
  • The limits of a mask file need not match the area of interest (from the trap layout file + buffer). The mask is padded as required to fill the area of interest, using either habitat or nonhabitat as selected by the user.
  • A trap layout file may specify locations for detectors outside the masked habitat; by default, these are dropped from analyses and simulations.
Only vector (polygon) masks are used in DENSITY 5.

TIP: Mask effects may be viewed with the map on the main screen. Both the integration mesh (map popup menu) and simulated locations of animals ('Animals' tool button) are restricted to habitat areas. A mask may be displayed in outline or as solid areas depending on the fill style in Options | Graphics.


Options Closed N

Options | Closed N

Closed population estimates. 'Estimator' echoes the selector on the main form - when one changes the other should change.

Closed population estimators
Relative upper bound
Losses on capture
 CAPTURE
Confidence intervals

Further options on this page apply when the relevant estimator is selected ('Radiotelemetry' depends on special input data).


Options Inverse prediction

Options | IP SECR

Fit spatially explicit detection model by simulation and inverse prediction


Options ML SECR

Options | ML SECR

Likelihood Full vs Conditional
Distribution Poisson vs Fixed N
Detection function
Within-session models
Between-session model
Initial values
Link functions
Profile likelihood intervals PLI
Goodness-of-fit test
 Bootstrap confidence intervals


Options Open population

Options | Open population

DENSITY provides a limited range of open-population analyses* and the options are correspondingly sparse.

Model

Select a model. The model you choose will determine how particular output fields are calculated. Some results appear in the output file only if the field is ticked in Options | Output. 'Reversed CJS' models are only available in tandem with Cormack-Jolly-Seber models.

Confidence intervals

Choose style of bootstrap confidence interval. Alpha is set globally in Options | Output. Studentized bootstrap intervals probably have the best coverage (i.e. close to the nominal alpha).

Intervals between sessions

If the interval between trapping sessions varies then it is useful to adjust the apparent survival rate φ(t) to a standard interval. These options specify the standard interval and the actual intervals between sampling sessions. The output field PhiAdj should be ticked in Options | Output.

φADJ (t) = exp ( log(φ(t)) . S / T(t, t+1) ),

where S is the standard interval and T(t, t+1) is the actual interval between sessions t and t+1. This example delivers quarterly φADJ , assuming the intervals are in days.

TIP: A multi-session dataset must be loaded (Read data) before interval values may be entered.

* Use MARK, POPAN or M-SURGE for more complex analyses.


Options Simulation

Options | Simulator

The Title and Output boxes are self-explanatory.

Population process and trend
Radio fixes in polygon
 Occupancy (Proportion of area used)


R interface

R interface R interface toolbutton

R is widely used free software for statistical computing (R Core Team 2012). User-contributed packages extend its core capabilities. The R package secr is an implementation of spatially explicit capture-recapture with many more features than DENSITY. This button opens a point-and-click interface to secr. Analyses specified on the main DENSITY form and related Options pages are translated to R commands that may be run in batch mode.

To use the interface, first install a recent version of R (>= 2.12.0). You can get it from the Comprehensive R Archive Network CRAN (cran.r-project.org). Then install the package secr; packages are available on CRAN, but it is usual to download and install them from within R once that has been installed.

The interface comprises a menu of potential tasks in the Task selector, tabbed Commands and Output windows, and various buttons. Tasks that are ticked will be translated into R commands in the Commands window when you click 'Rebuild with selected tasks' . Further tasks may be added by double-clicking in the Task selector. The translation takes account of (i) the currently active dataset, (ii) settings on the main form (buffer, detector type etc.), (iii) model definitions in Options, especially ML SECR, and (iv) other relevant Options settings. Most analyses in DENSITY can be translated to secr; the converse is not true.

If you are confident in R, and know something about secr, then you can tweak the analysis by editting the R code in the Commands window. Help on 'secr' is available from the Help menu in the form of the manual (collated help pages) and an overview pdf. Several of the tasks do not save the result as a new object; you can fix this by adding "myname <- " to the start of the relevant command (without quotes). You may also change object names from those in the table below, particularly to avoid overwriting 'fit', but later calls must be changed accordingly

Commands are executed in batch mode. Each execution is a separate R session. By default the R workspace is saved in a local .RData file at the end of a session and restored at the start of the next, so you can continue working with objects you have created.

TIP: On execution, R commands are written from the Commands window to a text file and R output from the current run only is saved in another text file. These files may be viewed directly from the View menu after any run. Editting the command file has no effect on subsequent executions.

The Commands window is split into an upper panel for preliminary tasks that will be performed also in each subsequent session, and a lower panel for tasks comprising the next phase of the analysis. The first three tasks are included automatically in the upper panel.

Task | Object(s) required | Object created | R function | Notes
Set working directory |  |  | setwd | From Options | General
Set line length |  |  | options | Increased from 80 to 100 to reduce need for wrapped output
Load package |  |  | library | Needed in each R session that uses secr
Read data |  | CH | read.capthist | Loads data into a capthist object and performs some integrity checks
Data summary | CH |  | summary* | Summarise spatial capture data
Make mask |  | mask | make.mask | Construct a mesh of points to use for numerical integration etc.
Read time covariates |  |  | read.table | Transfer data to a temporary file from the time covariates grid in Options | ML SECR; only relevant if ML SECR model uses within-session time covariate (names T1, T2...).
Read session covariates |  |  | read.table | Transfer data to a temporary file from the session covariates grid in Options | ML SECR; only relevant if ML SECR model uses between-session session covariate (names X1, X2...)
Fit ML SECR model | CH, mask | fit | secr.fit | Uses settings in Options | ML SECR
Display fitted model | fit |  | print* | Display ML SECR results
Parameter estimates only | fit |  | predict* | Predict real parameters (density, g0, sigma etc.) from fitted model
Derived estimates | fit |  | derived | Obtain density estimates from a conditional-likelihood model (incidentally provides effective sampling area esa and a breakdown of the sampling variance)
Check mask | fit |  | mask.check | Evaluate numerical effects of mesh spacing and buffer width on likelihood (LLonly = TRUE, the default) or parameter estimates (LLonly = FALSE)
SECR population size | fit |  | region.N | Report realised and expected population sizes in the masked area
Clear secrlist |  | secrlist |  | Start a list of fitted models
Add model to secrlist | secrlist | secrlist | secrlist | As it says
AIC secrlist | secrlist |  | AIC* | Report AIC model comparison of fitted models in secrlist
Nonspatial population size | CH |  | closedN | Conventional closed-population analyses
Fit IP SECR model | CH, mask |  | ip.secr | Uses settings in Options | IP SECR
* function names marked with an asterisk refer to S3 methods specific to 'secr' classes.

Number of cores

Some secr functions can make use the multiple CPUs that are present in modern desktop PCs. Particular speed improvement is seen with mask.check() and ip.secr(). To make use of this option, increase 'Number of cores' in Options | R interface from the default of 1. Quad-core machines may have 8 usable virtual cores. See ?Parallel in R (after loading secr with library(secr)). The Abort button is disabled when there are multiple cores as it is unclear how to terminate the worker processes cleanly.
Warning: This implementation of parallel computing is relatively untested and may fail. Please report problems.

Plotting

The tasks offered do not include graphics. You are free to type plot commands (plot(CH), plot(fit) etc.) into the Commands window, remembering that the target object (CH, fit etc.) should have been created earlier in the same batch of commands or in a previous batch. After execution, any plots can be found in the file Rplots.pdf, which may be displayed from the View menu.

Temporary data files

Some tasks require the transfer of data to R via intermediate temporary files. These have names like 'temp0001.txt'. They are created in the working directory at the time the task is transferred to the Commands window, and, by default, are deleted after 'Execute commands'. If you want to run the DENSITY-generated commands later in R (e.g., by copy and pasting into the R GUI) you will have to ensure the temporary files are still around. One way to do this is to untick 'Delete temporary files' in Options | R interface.

Temporary data files are used for time covariates, session covariates, filtered capture data, and possibly other tasks (wherever you see 'tempxxxx.txt' in the Commands window).

Notable differences between DENSITY and 'secr'

There are a few differences in terminology to note. In 'secr' the subtle distinction between a mask and a mesh has been lost; the term mask is used for both. In 'secr', Markov (one-time) effects in detection models are denoted 'B' rather than 'b1' as in DENSITY.

Detector layouts in 'secr' have a usage attribute that corresponds to the incomplete trap layout option in DENSITY. Usage specified in the detector layout is automatically taken into account when fitting models in 'secr'. In DENSITY you must 'switch it on' with Options | Input | Incomplete trap layout.

The default maximisation method in DENSITY is Nelder-Mead and the only alternative is BFGS. The method used by secr.fit called from DENSITY will therefore never match the default in secr.fit (Newton-Raphson).

For the ML SECR models they have in common, secr and DENSITY can be expected to produce very similar results. However, the way models are specified can differ quite a lot. Starting values are specified on the natural scale in DENSITY and on the link scale in secr, and the ordering of coefficients ('beta parameters') is also different.

See also: Options | R interface

TIP To perform an independent ML SECR analysis on one session of a multi-session dataset, manually change traps(CH) to, e.g., traps(CH[[1]]

References


Examples

DENSITY 5 examples

Seven test datasets are included. For three of these datasets we also provide worked examples that should help ease you into DENSITY.


Orongorongo Valley possum example

Example – Brushtail possum Trichosurus vulpecula

Photo: Kev Drew

 Brushtail possums are 2–4 kg largely arboreal marsupials that have become pests of forests and farmland in New Zealand since their introduction from Australia in the nineteenth century. Their population dynamics in mixed native forest have been studied by capture–recapture in the Orongorongo Valley near Wellington (e.g. Efford 1998). From 1996 to 2006 a grid of 167 traps set on the ground at 30-m spacing was operated in an area of about 14 ha for 5 consecutive days three times each year (Efford 2000; Efford and Cowan 2005). Each trap could catch only one animal, with rare exceptions when a young 'backrider' entered the trap with its mother. All animals were tagged and tattooed for individual identification and released at the site of capture. A broad shingle riverbed forms a natural boundary on two sides of the study grid. Possums are long-lived (up to about 15 years) and as adults restrict their movements to a home range of 1–10 ha. Breeding is seasonal, resulting in an influx of newly independent juveniles in the first trapping of each calendar year.

This example uses data from the six trapping sessions in 1996 and 1997, a time of high and declining density. A step-by-step tutorial introduces maximum likelihood spatially explicit capture-recapture (ML SECR) and some advanced features of DENSITY.

Steps

  1. Start DENSITY. You will see the main screen.
  2. Click the 'Options' button and select as a working directory the one containing files starting with 'OV'.
    Exit the Options form to apply this setting.
  3. Trap layout : select the file OVtrap.txt; also increase the buffer width to 120 m.
  4. Capture data : select the file OV4954.txt and format XY.
    Your screen should look like this:

  5. Click 'Read data'.
    On the left, the trap map will appear:

    and, on the right, the Session statistics:

  6. Explore the various statistical outputs and graphical options.
    - Click the 'Captures' button to overlay capture information
    - Right-click on the map for popup menu of display options
    - Try 'Select by animal' and 'Show tracks' on the popup menu
    - Note how the status bar changes as you move the cursor over the map with the mouse
    - Scroll between trapping sessions with the 'Session selector'
    - Try different estimators of closed population size (N) from the drop-down box
    - Under the 'ETA density' tab, view the effect of varying boundary strip width

  7. You can get a better feeling for the study by displaying a background image under the trap map. In Options | Graphics, enter the name of the image and the coordinates of the left, right, top and bottom edges:

    A broad shingle river bed bounds the trapping grid to the north and west. A field station lies in a clearing within the grid near trap sites 4560 and 4860. If you want to clear the image, untick 'Show background image' on the popup menu.

  8. Try ML SECR. Tick the analysis box, click 'GO' at the top of the screen, and monitor progress.
    You can expect a result like this:

    g0[.] σ[.] is the default model, equivalent to the null model M0 in CAPTURE. 'LL' is the value of the log likelihood for the last evaluation, and 'sec' is the time taken for one evaluation in seconds. The remaining fields are estimates of the parameters in the model.

    Fitting took nearly 1.4 minutes on my computer. You can speed this up by selecting 'conditional likelihood' in 'Options | ML SECR' (use the button to the left of the tick box to go there) or by cutting corners in the numerical methods (reducing the number of points in the integration mesh, or possibly increasing the tolerance for maximisation).

    More complete output is added to the log file - click 'View log' to review it at any time. Click here for an example. Tabular output also appears in the 'output file'; if the column headings seem obscure, try 'Tools | Append to output | Legend'.

  9. These calculations ignore the fact that possums mostly do not live in the river bed. In order to mask off that area as non-habitat:
    • go to Options | Habitat mask
    • select 'OVmask.txt' as a mask file
    • click the 'On' radio button and exit Options.
    White areas are non-habitat. Verify this by clicking the 'Animals' button to view a hypothetical distribution of home-range centres.

    Click GO again for revised estimates using the habitat mask. This time I chose to use conditional likelihood:

    Note that the parameters in the fitted model (above) do not include Density! This is calculated as a derived parameter, and tabulated thus in the log file ('Mt1' is the number of individuals caught, often shown as 'n'; 'esa' is the effective sampling area*):

    OV derived density estimate
    Note also the increase in speed. This time, the estimated density (14.6 / ha) is somewhat greater than before (13.6 / ha). The difference is due entirely to the habitat mask. Intuitively, excluding possums from some parts of the surrounding habitat requires higher density elsewhere to explain the observed captures.

  10. Back at the start, we said the traps could catch just one animal at a time, but we have used ML SECR to fit a model that assumes independence between animals. This is a potentially serious breach of model assumptions. We can fit the same model by simulation and inverse prediction (IP SECR), taking care to simulate single-catch traps instead of assuming independence (Efford 2004). Simply tick the IP SECR box and click GO. The resulting density estimate (with mask: 14.42 / ha, SE 0.96 / ha) is remarkably close to that from ML SECR. This is consistent with simulations suggesting negligible effect of competition between animals for traps on density estimates, even when most traps are occupied (Efford, Borchers and Byrom 2009). Estimates of the scale parameter σ are also remarkably consistent (IP SECR 27.7 m, SE 1.0 m; ML SECR 27.3 m, SE 1.0 m). The difference is in the 'intercept' or 'magnitude' parameter of the detection function g0 (IP SECR 0.150, SE 0.015; ML SECR 0.099, SE 0.008). Clearly, we should be more inclined to believe estimates of g0 from IP SECR, at least until someone devises a likelihood-based method for single-catch traps.

  11. ML SECR offers a great variety of possibilities with respect to detection functions and alternative models (review Options | ML SECR). In principle, we may use likelihood-based criteria such as AIC to choose between models, or to obtain model-averaged estimates. We do not at present know how these methods perform when there is a systematic mis-match between the model and the data (e.g., the single-catch vs multiple-catch trap issue of the previous section).

* DO NOT confuse 'esa' with 'ETA' (effective trapping area). These are radically different concepts. 'esa' is defined so that D-hat = n / esa-hat, whereas D-hat = N-hat / ETA for a population estimate N-hat (Borchers and Efford 2008; Efford, Borchers and Byrom 2009). 'esa' is equivalent to 'effective detection radius' and 'effective detection area' from distance sampling. 'esa' summarises all aspects of detection, not just the spatial ones.

References


Ferret example

Example - Ferret Mustela furo

Photo: Grant Norbury

 Ferrets are an invasive species especially common in New Zealand farmland, where they prey on introduced rabbits and a variety of native fauna. They commonly contract bovine tuberculosis, probably mostly by feeding on infected carrion. They may also contract the disease from other ferrets at a rate high enough to form a wildlife reservoir, although this probably occurs only above a threshold density of about 3 per km2 (averaged throughout the year).
Ferret home ranges are large and ferrets can be extremely mobile. Monitoring is made easier by their high trappability in live traps such as the one shown here. Ferrets are easily restrained in a mesh sleeve for ear tagging.
Photo: Grant Norbury

This tutorial introduces the basic features of DENSITY. We use data from a pastoral sheep station in central Otago, New Zealand, obtained in trials by Landcare Research for the New Zealand Animal Health Board. The area has the code 'H1' (for 'hotspot study area 1'). Trapping was conducted over 6 days in autumn of 2003.

Steps

1. Start DENSITY
e.g. click on density5.exe in Windows Explorer 		ferret toolbar
2. | Click the 'Options' button and adjust these settings:
Options | General Select as a working directory the folder containing the ferret files (names start with 'Bend') ferret working directory
Options | Output | 'Units of Area' should be 'sq km'
Exit Options to apply changes.
3. | Trap layout
Select the file 'Bend H1 LCR gps.txt'

ferret trap layout
Increase buffer width to 1500 m
TIP: Double-click on the file name to review the data.
The first column is a trap ID - it does not need to be a numeric. The other two columns are X-Y coordinates of trap sites obtained by GPS. 		1 2217740 5578187
2 2217727 5577912
3 2217545 5577692
etc.
4. | Capture data
Select the file 'Bend H1 LCR capt.txt'

These data are in 'TrapID' format.

ferret capture data
TIP: Double-click on the file name to review the data.
Comments are preceded by ';' or '#'. The fourth row reminds us of the column headings, although these do not line up. There is only one 'session', so the first column is the same (H1) in all data rows. The last column is a cross reference to the TrapID in the trap layout file. 		# Central Otago ferret captures
# use with trap file Bend H1 LCR gps.txt
# TrapID format
# Session Tag Day TrapID
H1 3436     1    8
H1 2705     1    4
H1 3438     1    14
etc.
5. | Read data
Now click the 'Read data' tool button (above) to load the data into DENSITY. The interface comes alive: new tool buttons are enabled and the trap map will appear.
Click 'Captures' to show where ferrets were caught. In the example, additional display options have been selected.

TIP: Right-click for the popup menu of display options, or find it under View | Map popup menu

TIP: 'Select by animal' highlights individuals.

TIP: If the menu offers only a 100-m grid then go to Options | Output and select Units of area = 'sq. km'

Locate trap site 25 by gliding the cursor over the map and checking the status bar at the bottom of your screen. Now click on it. Captures at this site should be displayed in a panel.

TIP: It's easier if you enlarge the map. If necessary, use 'Label trap sites', then re-click on 'Captures'

We see that ferret 1974 was caught 6 days out of 6 at this one site. Fixation on a single site violates assumption 2 ('Capture does not affect the pattern of movement of an animal within a trapping session') and we should be careful.

ferret map
6. The 'session statistics' panel presents useful 'closed-population' summaries of the data.

TIP: It's wise to review the Summary tabbed page. Do the numbers caught each day tally with what you know? Are the frequencies of capture (f - the number of captures per animal) what you expect?

 ferret session summary
7. Now for some serious analyses. Results will be written to an output file (named in Options | Output).

TIP: lick on Analyses to access relevant Options

 ferret analyses

8.

Density estimates

IP SECR and ML SECR are alternative numerical methods for fitting a spatial detection model. Both need 'initial values' for the three parameters. Select ML SECR and click the side button to view the relevant Options page. Initial values are computed automatically as long as 'Auto' is selected; you can see them by clicking 'Refresh'.
We will compare the results from IP SECR and ML SECR. The procedure is similar for each method: tick the relevant analysis box on the main form, check the Options by clicking the side button, Exit to the main form and click 'GO'. | ferret go and view output

a. IP SECR
There will be a pause as DENSITY finds the initial values. Progress is then recorded through the 8 vertices and 3 centre points (also counted as 'vertices') of each simulation experiment. With the ferret example, two experiments ('boxes') are needed to locate the answer. The answer arrives in about 1.5 minutes on a 2.9 GHz i7 PC.
Click 'View output' for the results. You should have something like this
ferret IP SECR
TIP: Your output file will not look exactly the same because we set Options | Output 'Output style' to 'Stacked' .
We know the IP search completed successfully because IPCode=OK. The estimated density is 3.8 per km2 (SE 0.45). The fitted half-normal detection function has parameters g(0) = 0.18 (SE 0.024) and σ = 340 m (SE 19). Parameter estimates vary slightly from run to run as they depend on Monte Carlo simulations - reduce CV and increase the number of replicates for greater consistency.

b. ML SECR
Repeating the analysis using a conditional likelihood maximization:
ferret ML secr
Once again we have tweaked the output settings for display purposes: some fields have been omitted and a legend has been added (see Options | Output)
The results are not appreciably different from the IP SECR estimates except that MLg0 is lower than IPg0. This is an expected and presently unavoidable artifact of using the multi-live likelihood for single-live data.

c. R package estimates
We won't go into these in detail. The steps are
  1. click the R interface tool button on the main form
  2. select Fit ML SECR model, Display fitted model, and Derived estimates from the Task Selector.
  3. click Rebuild with selected tasks
  4. click Execute commands and wait (there is no progress report)
The results (below) are very much like those from ML SECR in DENSITY. Note that the units of density are always animals/hectare in secr.
ferret secr
TIP: Aborting secr from DENSITY is a slow and painful process; avoid it if you can.
9. | Movement assumptions
Using the spatial detection model we assume that the movements of animals are oriented uniformly and are not affected by previous capture. The 'Movements' page allows a check on movement assumptions. Recaptures of these ferrets were often at the same site as the previous capture - 39.7% of the time, in fact. This seems excessive, but is it more than you would expect?

To answer this we perform a Monte Carlo test using the fitted density = 3.75 / km2, g(0) = 0.180 and σ = 340 m.

Click the Monte Carlo test button on the 'Movements' page and type these values into the box. Then click GO. Results like those on the right will eventually appear 't2/r2' is a statistic that decreases with increasing autocorrelation. A value as small as that observed (t2/r2 = 1.71) occurred by chance in only 8 simulations of the 999 performed (P = 0.008). This is strong evidence that our ferrets did not behave according to the model, which might reduce our confidence in the computed density.

movement test
Does this greatly affect the estimates? Our provisional answer is 'No'. IP SECR density estimates using the 'd-bar' home range measure are sensitive to behavioural effects (serial correlation of location). Here we used the 'RPSV' home range measure, which is much less sensitive.

TIP: See Options | IP SECR to toggle between the two measures d-bar and RPSV

One way to improve IP SECR estimates in this case is to use the 'd-bar' movement statistic and to drop from the calculation of the mean any zero values for recapture distance (Zero truncate in Options | IP SECR - Advanced). The resulting density estimate is 4.69 / ha (SE 0.61).
A less ad hoc approach is to fit a model with learned trap response by maximum likelihood. The resulting model has lower AIC than the previous ML SECR model, and the estimates resemble those from the ad hoc method.
ferret ML SECR b


Trapping web example

Example - trapping-web data of Parmenter et al. 2003

The trapping web design has received limited use since proposed by Anderson et al. (1983). A large recent trial generated significant new web data from enclosed populations whose sizes were also estimated by intensive enumeration. High-profile publication of the trial promises to revive interest in trapping webs (Parmenter et al. 2003).

This example shows how DENSITY may be used both to replicate the distance analyses of Parmenter et al (2003) and to generate alternative estimates by SECR. We thank Bob Parmenter for providing the raw data. We assume you already know how to use DENSITY.

Warning: The output here is from version 3, except for added ML SECR analyses. The Distance interface was removed from DENSITY 5, so the trapping web analyses cannot be repeated as shown. The material is retained for its historical interest.

The study used single-catch (Sherman) live traps that were open overnight and closed during the day. The trap layout ('websites.txt') comprised four closely spaced inner rings (5-m spacing) and 8 more widely spaced outer rings (10-m spacing), and 4 traps in the centre. There were 12 arms for a total of 148 traps (you might like to try duplicating this layout with Trap builder). The square fence comes within 5 m of the web at four points - to emulate this we set the 'Buffer width' to 5 m.

Four different enclosures were used. The capture data ('webcapt.txt') are generally sparse. Except for Perognathus flavus (all 4 enclosures) and Peromyscus maniculatus (2 enclosures), it was necessary to combine species as 'small-bodied murid rodents' (4 enclosures) and 'heteromyid kangaroo rats' (combined sample of two species from one enclosure; R. Parmenter pers. comm.). As a result there are 11 data sets. DENSITY treats each data set as a separate 'session' (i.e. they are distinguished by the code in the first column of the capture file).

On 'Read data' the following summary appears in the Log:

Data set 2 is a basket case for capture-recapture analysis - there was only one recapture and that was at the same site as the first capture of the animal (dbar = 0). Also note that DENSITY has wrongly inferred there were only 4 capture occasions in this data set, as no animals were caught on one occasion.

DISTANCE

By calling DISTANCE from DENSITY we can emulate the trapping-web analysis of Parmenter et al (2003). DENSITY defaults to the analysis they recommend (uniform detection function with cosine adjustment terms selected by AIC and 'weak' monotonic constraint).
  1. Enable distance analysis in Options | Distance (we assume you have the DISTANCE program)
  2. Also in Options | Distance, select 'Web(s)' as the 'Distance type' and 'Group data for analysis'
  3. Click 'Auto web'. This automatically parses the trap layout file and suggests breakpoints for the grouped analysis.
  4. Exit Options
  5. Back on the main form, unselect 'Closed population' and 'IP SECR' analyses, and select 'Distance'.
  6. Click the 'Go All' tool button and review the output file, which will look something like this:

This is in close agreement with Table 8 of Parmenter et al. (2003), except that they cite a density of 19.3 ± 5.6 for dataset 4 and 4.3 ± 1.1 for dataset 6. Their results for datasets 4 and 6 can be gotten from DISTANCE by forcing the number of cosine adjustment terms to 1 and 0 respectively (Options | Distance NAP). Pw is the fitted capture probability - the proportion of animals detected within the perimeter of the web. In 7 cases out of 11 the estimate of Pw is 1.0 (8/11 if we include dataset 6 with NAP=0). The DISTANCE estimate of density for these datasets is just the number of animals caught divided by the area of the web (with an arbitrary half-trap spacing extension). More detailed DISTANCE output may be viewed for each dataset in turn from the 'Distance' tabbed page.

Density by simulation and inverse prediction (IP SECR)

For an alternative analysis, select 'IP SECR' and unselect 'Distance'. Ensure the Session selector is on '1' and click 'GO All'.

Failure of the algorithm with dataset 2 is no surprise, and we will take it no further. Dataset 4 is more problematic because there were a fair number of recaptures (23). Looking at the histogram of recapture distances we find one outlying movement:

Outliers such as this may result from data errors or dispersal movements. If we remove the first capture of animal 7 (e.g. by prefixing its record with a comment symbol ';') then inverse prediction delivers a usable answer :

Fitting the spatial detection model provides other useful information. Home ranges of P. flavus (σ 13–17 m) were substantially and consistently smaller than those of other species (σ 32–45 m) except possibly Dipodomys spp (14 m) [Note range area scales with σ2]. Estimated values of g(0) for P. flavus (0.014–0.022) were contained within the range of the other taxa (0.013–0.062) excluding Dipodomys spp (0.114). The small ranges of P. flavus are therefore primarily responsible for the low overall trappability shown by the conventional closed-population estimates (see output for phat above).

To enumerate the 'true' population, Parmenter et al. (2003) followed web trapping and grid trapping (not discussed here) with trapping on a 22 x 22 grid until no new animals were caught (5, 6, 7 and 8 nights in the four enclosures). They did not present data by which we might evaluate the enumeration. It is conceivable that the least trappable species P. flavus was not completely enumerated. A further use of the detection function we have fitted is to simulate the possible failure of enumeration for P. flavus. We do not present results here, but suggest you experiment with Simulation and the trap file 'removalgrid.txt', given D=22/ha, g(0)=0.015 and σ=15 m. (Use a zero-width buffer and a single-live detector as animals were released alive).
TIP: The field Day0 is useful - look at the bottom of the field list in Simulation.
TIP: A full evaluation would require simulation of all three phases of marking, and population turnover.

The inverse prediction method fits a global Poisson spatial model, and a good deal of the sampling variance may derive from the uncertainty of a random finite quadrat laid on this infinite pattern. Our 'quadrat' has fuzzy edges and is not square, but the principle still applies. For comparison it helps to adjust the sampling error of the inverse prediction estimates for spatial variance in the fitted model. To do this we infer the 'effective trapping area', estimate the spatial variance of a Poisson process on that area, and subtract it from the inverse prediction variance. The square root of this residual variance is 'SE.IPAdj' (for internal reasons DENSITY copies the estimate itself as IPAdj).

Maximum likelihood estimates of density (ML SECR)

In this case, estimates from maximising the full likelihood in DENSITY were slightly smaller than those from maximising the conditional likelihood (Table).
Here we use the R interface to get MLE from the R package 'secr'.
  • Read the trapping web data into the main form as above
  • In Options | ML SECR, select Conditional likelihood and Binomial distribution and exit.
  • Back on the main form, click the R interface tool button.
  • In addition to the default tasks, select 'Fit ML SECR model' and 'Derived estimates (CL)'.
  • Click 'Rebuild with selected tasks'
  • Click 'Execute Commands'
These commands were generated automatically by the R interface in DENSITY 5.0:
# import data from text files to capthist object CH
CH <- read.capthist (captfile = "D:/Density 5.0/bin5/webcapt.txt", trapfile = "D:/Density 5.0/bin5/website.txt", fmt = "trapID", detector = "single")

# summarise capthist object
summary (CH)

# build habitat mask
mask <- make.mask (traps(CH), buffer = 5, nx = 64)

# ML fit of spatially explicit capture-recapture model(s)
fit <- mapply(secr.fit, CH, mask = mask, MoreArgs = list(CL = TRUE, model = list (g0 ~ 1, sigma ~ 1), details = list(distribution = "binomial"), link = list(g0 = "log",sigma = "identity"), trace = FALSE, verify = FALSE), SIMPLIFY = FALSE)

# derived estimates, including H-T estimate of density
lapply(fit, derived)

The 'secr.fit' call is nested within 'mapply' to conduct a separate analysis for each session. By setting Distribution = Binomial in Options | ML SECR we obtain SE for the realised (spatially conditional) population.

TIP If estimation fails in one session you can edit the R commands to drop that component of fit, the list of fitted models, to avoid a downstream crash. In the full likelihood analysis, for example, use a negative subscript 2 to drop the second dataset: lapply(do.call(secrlist,fit[-2]), predict)

Executing these commands from the interface gives ML SECR estimates for comparison with enumeration, distance and inverse prediction. With minor exceptions noted below, the results from R were numerically identical to the DENSITY results at the precision reported here.

Table. Comparison of density estimates for enclosed rodent populations by three methods (trapping webs datasets of Parmenter et al. 2003). Exhaustive removal (enumeration) is the 'true density' of the original paper. Distance analyses fitted a uniform detection function with cosine adjustments selected by AIC (constrained to weak monotonicity). IP SECR estimates used a null closed-population model and the RPSV home range measure; SE adjusted for spatial variance.
 |  | Density estimates (rodents/ha) ± 1SE
Dataset | Species | Enumeration | Distance | IP SECR | ML SECR Full | ML SECR CL
1 | P. flavus | 20.6 | 22.2 ± 5.6 | 22.8 ± 7.7 | 18.1 ± 3.6 | 18.4 ± 3.6
2 | P. flavus | 9.4 | 13.1 ± 4.2 | No estimate | No estimate | No estimate
3 | P. flavus | 13.8 | 10.4 ± 1.7 | 22.0 ± 6.4 | 14.9 ± 2.4 | 15.2 ± 2.4
4 | P. flavus | 19.1 | 42.6 ± 16.31 | 22.9 ± 5.43 | 16.9 ± 2.7 | 17.1 ± 2.7
5 | Cricetines | 15.7 | 14.7 ± 2.1 | 12.7 ± 0.5 | 12.1 ± 0.4 | 12.2 ± 0.4
6 | Cricetines | 5.2 | 19.1 ± 7.72 | 3.8 ± 0.2 | 3.4 ± NA5 | 3.5 ± 0.2
7 | Cricetines | 7.8 | 4.9 ± 1.2 | 5.1 ± 1.1 | 4.7 ± 0.7 | 4.9 ± 0.7
8 | Cricetines | 7.7 | 8.1 ± 1.5 | 7.0 ± 0.4 | 6.6 ± 0.4 | 6.8 ± 0.4
9 | P. maniculatus | 6.3 | 6.6 ± 1.4 | 6.1 ± NA4 | 5.5 ± 0.3 | 5.6 ± 0.4
10 | P. maniculatus | 3.3 | 2.6 ± 0.9 | 2.5 ± 0.6 | 2.4 ± 0.5 | 2.6 ± 0.5
11 | Dipodomys spp. | 4.3 | 3.4 ± 1.0 | 3.7 ± 0.6 | 3.8 ± 0.8 | 4.0 ± 0.8

1. Reported as 19.3 ± 5.6 by Parmenter et al. 2003
2. Reported as 4.3 ± 1.1 by Parmenter et al. 2003
3. Estimate obtained by dropping one capture record.
4. Estimated sampling variance less than estimated spatial variance. SE <= 1.2
5. No SE from DENSITY, SE = 0.2 from R

References


Simulator

The DENSITY simulator covers a wide range of scenarios and is unavoidably complex. The toolbar is largely self explanatory (buttons correspond to those on the main form except for D contours and Histograms). Otherwise, there are three major groups of controls SIMULATED POPULATION, TRAPPING AND ESTIMATION, and SIMULATION CONTROL AND REPORTING. The first two combine to define 'experiments' as explained here. The Quick Start guide may tell you all you need to know.

simulator

See also Structure, Simulated Population, Trapping and Estimation, Control and Reporting, Quick Start, Tools, Terminology


Simulation Quick Start

Simulator quick start

How to run simulations in DENSITY

  1. Start DENSITY
  2. Click 'Simulator' button to open the simulation form. Name a trap layout file if you intend to do spatial simulations. If necessary use Trap Builder to make a trap layout file.
  3. Simulated population Specify the population you will sample. For spatial sampling, you must at least specify population density D and the parameters of detection in the basic model (g0, σ). For non-spatial simulations, change the Detector Model to 'Nonspatial' or 'Occupancy'
  4. Trapping and estimation Specify buffer width, trap type, and occasions per session (see also Trap layout)
  5. Trapping and estimation Select a closed population estimator (needed for IP SECR)
  6. Trapping and estimation Select Analyses e.g. ML SECR
  7. Simulation control and reporting Specify the desired number of replicates and reporting options.
  8. Review relevant settings on the shared Options form - particularly the General and Simulator pages.
  9. Click GO.
The order of steps 3 to 8 does not matter.

TIP: If you have already opened data files on the main screen, use the <ctrl T> key combination to quickly set up simulations using the same trap file and population parameters.

See also Structure, Simulated Population, Trapping and Estimation, Control and Reporting


Simulation structure

The structure of simulations

A simulation has two main parts: the simulated population (density, individual attributes, turnover, trappability etc) and the simulated trapping-and-estimation process (trap layout, number of occasions, estimators etc). Settings for these parts appear in two blocks on the screen:

Probably you want to compare the results for several settings in each block. Select the values you want and click 'Add' to build a stack of scenarios on each side. (If you forget to 'Add' anything to a stack, DENSITY will use the current values).

A simulation run comprises a set of experiments. Each experiment combines one line from the 'simulation' stack and one line from the 'trapping and estimation' stack. In this example we have added a second trap layout file, so there are two scenarios in the 'trapping and estimation' stack. 'GO' will now conduct six experiments, three with trap layout A and three with trap layout B.

The scenarios are placed on each stack in coded form. The contents of each stack may exported to a text file, edited, and re-imported (use the buttons). No documentation is provided for the stack formats as you will seldom need to bother with them. If necessary, experiment by exporting different settings to discover how they work.

TIP: The first value in each row of the simulation stack is a group number, and consecutive rows with ascending group numbers are interpreted as groups in the same scenario.

TIP: Although this all sounds complex, the information at the head of the output file should make clear what you have achieved. Try running some simulations to get the feel of it.


Simulated Population General

Simulated population

simulated population general

The primary setting is the detection model. If you choose a nonspatial detection model then various spatial options are disabled. Notice the dropdown option to resample an existing capture file.

Nonspatial N may either be fixed at the expected value or allowed to vary as a Poisson variate. In the case of a spatial simulation an equivalent choice is made between fixing the number of individuals to be simulated within the arena (traps + buffer), or allowing it to vary as a Poisson variate. Choice of a nonspatial detection model suppresses spatial and trap-specific options in the Trapping and Estimation box.

Individual heterogeneity may be specified in parameters g0 and sigma via the continuous distributions in the dropdown boxes, or by adding groups of animals with different characteristics.

Tabbed pages

Dispersion
g0(tbk)
Movement
Turnover
Advanced

TIP: For non-spatial simulations, set the detection model to 'Nonspatial' under 'DETECTION MODEL'

See also Detection functions, Heterogeneity, Groups, Resampling


Simulation – Trapping and estimation

trapping and estimation

The Simulator draws samples from a spatially dispersed population according to a spatial detection model. Simulating SECR estimation is slow and by default it is turned off. Summaries of the spatial capture data may be informative even when SECR models are not fitted.

Select one or more trap layout files. Simulations will be repeated for each trap layout that is selected when lines are added to the stack.

To simulate for different numbers of occasions (days) per session - select each number in turn and click '>' to add it to the list of levels in the read-only box to the right. An experiment will then be run with each possible level of the number of occasions.

The closed population estimator provides the field N-hat in the output; it is also used for IP SECR but not ML SECR.

Blocks of analyses (ML SECR etc.) are selected as on the main form. Nonspatial 'Closed N' and 'Open population' analyses are controlled by settings in Options (use side buttons). Settings for the SECR analyses are a bit more complicated (see bottom of this page).

Tabbed pages

Vary traps

Advanced

Simulating likelihood-based density estimation (ML SECR)

Parameter or setting | Where set
Buffer width (beyond outermost trap) | Simulator Trapping & Estimation
Initial parameter values | Options | ML SECR
Random number generator & seed | Options | General
Detection model (Half-normal, Hazard-rate, Exponential)* | Options | ML SECR
Full or Conditional likelihood | Options | ML SECR
Poisson or Binomial distribution | Options | ML SECR
etc. | Options | ML SECR

Simulating inverse prediction (IP SECR)

Parameter or setting | Where set
Buffer width (beyond outermost trap) | Simulator Trapping & Estimation
Closed-population estimator (Null, Jackknife etc.) | Simulator Trapping & Estimation
Initial parameter values | Options | IP SECR
Random number generator & seed | Options | General
Simulated dispersion (Poisson, Even)* | Options | IP SECR
Detection model (Half-normal, Uniform)* | Options | IP SECR
Size of search box | Options | IP SECR
Number of replicate simulations during search | Options | IP SECR

* Settings marked with an asterisk are independent of the dispersion and detection model of the simulated population (Population parameters | Advanced).

The default values should be adequate, except for 'Buffer width' (see Trap layout). For half-normal detection, 'Buffer width' should be at least 3 times the largest expected value of σ, and 4 times σ is better. For uniform detection, 'Buffer width' should be at least as large as the largest expected σ. Note that range centres are simulated within the same buffered area as specified for analysis: no provision is made for testing inadequate buffer strips.


Simulation control and reporting

This panel controls -

  • the number of simulations (replicates)
  • whether to overwrite any existing output files
  • selection of output fields and statistics
  • report format
  • export of raw capture data
Other important settings are provided in Options | Simulator. See particularly the definition and fitting of simple trend models when a population is simulated over time.

Simulation control and reporting

Fields and Statistics

Simulation output is provided for a list of 'fields' (Ncapt, Nhat etc.) summarised with 'statistics' (mean, SE etc.). Fields and statistics are selected by the user from lists appropriate to each analysis. Some fields are selected by default on the basis of the analysis groups selected in Trapping and estimation. Use the buttons here to review and change the selection. More detail on the available statistics and fields is given here. Output appears in a text file ('View Report' button).

Report format

The 'Output' section of the text file produced by the simulator uses these formats:
Detail lines | One line of output for each simulation
Summary statistics | One line of output for each statistic at each parameter level
Field x experiment summary | A separate table for each statistic and field combination (e.g. Mean(N-hat)). The columns of the table are different 'Experiments' (simulated populations) and the rows are different 'Trapping and estimation' settings (TES).

You may select more than one format, but the results will then be more difficult to read.

The 'Other options' button in 'Simulation control and reporting' will take you to additional settings for controlling output in Options | Simulation.

The number of decimal places cannot be varied by users.

Export capture data

Ticking this box enables the 'Export format' button, which displays a list of possible export formats.

Some options generate voluminous output in the named file. Detailed documentation is not provided. It is suggested that you experiment. Double-click on the file name to view the output.

Mostly, data are exported for each replicate of each experiment. The experiment & replicate are coded with an 11-digit initial identifier (e.g. 00000100001 for experiment 1, replicate 1). Formats with a subscript '(i)' generate one summary row per replicate. The values 1...i on that row correspond to occasions 1...i.

Raw captures XY | Capture data* in XY format suitable for input to the main form of Density
Raw captures TrapID | Capture data* in TrapID format suitable for input to the main form of Density
n(i), f(i), u(i), M(i) | Closed-population data summaries cf Otis et al (1978)
Distance | Data that can be read directly by DISTANCE
Closed capture histories | Data that can be read directly by MARK
Open capture histories | Data that can be read directly by MARK (multi-session 'open population' analyses only)
Site histories | Number of detections for each trap site on each occasion
Cumulative trap success (i) | Number of trap (bait) sites visited on or before occasion i
Raw animals | Locations of simulated animals. 'caught' indicates whether trapped in current session, 'copynum' is for supernumerary individuals (see Overdispersion).
Number in group | Number in each group (state) (both trapped and untrapped)
m-array | 'Reduced m-array' summary of CJS data (multi-session 'open population' analyses only). First column is size of each release cohort (Ri); remaining columns are the numbers from the first recaptured at session i+1, i+2 etc.

* These covariates are appended to each capture record: (i) group number (ii) distance from animal to trap (metres).


Technical details

Technical information

ML SECR documentation
Estimating density by inverse prediction
 Automatic initial values
Trapping simulation algorithm
 Random number generator
Pxy contours
Habitat masks
System requirements
Files created by Density
Test data sets
 Program limits


Density estimation method

Estimating density by inverse prediction

Simulation and inverse prediction (IP SECR) is one of two methods in DENSITY for fitting a spatial detection model to estimate animal population density D. (The other more important one is maximum likelihood ML SECR). D is understood as the intensity parameter of a spatial point process for home-range centres. The detection model is a function g(d) where d is the distance between an animal's home-range centre and a trap. The parameters of g are:

g(0) the probability of capture when the trap and range centre coincide

σ spatial scale, representing decline in capture probability with distance
(e.g. standard deviation of a half-normal distribution).

Example of half-normal detection function with g(0) = 0.4 and σ = 50 m.

The parameters (D, g(0) and σ) cannot usually be estimated directly from mark-recapture data. However, three statistics to which they are related (N-hat, P-hat and HR) may be calculated from a mark-recapture sample. N-hat and P-hat are conventional closed-population estimates of population size and capture probability (Otis et al. 1978; Borchers et al. 2002; Chao & Huggins 2004a).

'HR' is a statistic that increases with home range size. Density 5 defaults to 'RPSV' (root pooled spatial variance). The alternative is 'd-bar'.

The actual relationship between the statistics and the parameters in which we are really interested, particularly D, depends in a complex and unknown way on the layout of the traps and other aspects of sampling design. By simulating the trapping process we generate samples from which N-hat, P-hat and HR are calculated for known D, g(0) and σ, while controlling for trap layout etc. Given field estimates N-hat, P-hat and HR we can reverse the process and apply inverse prediction to infer D, g(0) and σ.

Inverse prediction

Matrix methods for inverse prediction using multiresponse linear models are described by Pledger and Efford (1998; see also Carothers 1979 and Efford et al. 2004). Let y = (N-hat, P-hat, HR) be a vector of statistics obtained by a known sampling process T from a population with parameters θ = (D, g(0), σ), i.e.
 | , where the εi are assumed to have mean zero.
Then | is an estimate of θ.

We estimate FT by fitting a linear model to a large sample of yi obtained by simulation for known θ. Although the overall relationship is likely to be curved, a planar interpolation appears sufficient in the region of parameter space near θ. A numerical search is conducted to find a small region (a box in parameter space) that contains θi . θi and its variance-covariance matrix is then obtained by applying the inverse of FT (e.g. Pledger & Efford 1998; more technical statement of the theory ).

Simulating the trapping process

All the above assumes that we have a realistic algorithm for simulating population samples obtained with a spatial array of traps given a known density and detection function. Such an algorithm should account for the competition between animals for traps and between traps for animals that results from the declining pool of available traps and animals within a trapping period (e.g. overnight, assuming each trap can catch one animal). A suitable algorithm is described by Efford 2004.

More on the parameters

Biologists have become so used to ignoring the spatial structure of trapping data that the more fundamental parameters D, g(0) and σ are unfamiliar. D is a true density; it is equivalent to the intensity of a spatial point process. g(0) is analogous to the similarly named parameter in distance methods of animal census (Buckland et al. 1993). σ is a scale parameter for the interaction between an individual animal and a trap.

g(d) gives the actual probability of capture only when there is a single animal and a single trap. In all other cases there is a risk of trap competition or trap saturation. These effects are handled automatically by the simulation algorithm, which progressively removes traps and animals from the available pool as captures occur over a particular interval (e.g. one trapping night).

References


Automatic calculation of starting values

Automatic calculation of initial values

Initial values of the three parameters D, g0, and σ are required for density estimation by IP SECR. ML SECR also requires initial values for all parameters in the model; these include at least g0 and σ. Good initial values can make the difference between a speedy, fruitful search and failure. These notes explain the automatic algorithm used to obtain initial values, for which we use the subscript S for 'start'.

To get initial values we use the simplifying assumption that competition is negligible both among traps for animals and among animals for traps. This is strictly true for proximity detectors.

Estimates of σS and g0S both use numerical (Monte Carlo) integration; accuracy depends on the number of random points sampled within the trapping area A (See Options | Computation).

Initial detection scale σS

The expected distance between recaptures may be inferred from σ and the trap layout:

where the indices i and j refer to traps, pi is the 'naïve' probability of an animal located somewhere within area A being caught in trap i, and Rij is the distance between traps i and j.

Using the half-normal model

where r is the distance between an animal's range centre at x,y and trap i.

The integrals are evaluated by sampling points x,y within an area A. The area A, approximately the effective trapping area, is limited to include only locations where animals are 'trappable' by some rough criterion (e.g. pi > 0.05). A factor of g02 appears in both numerator and denominator and cancels out.

Numerical minimisation (the 'golden' routine of Press et al. (1989)) is used to find the value of σ for which E(d-bar) matches the observed d-bar for the given trap configuration. Evaluation of Eqn 1 is time-consuming (O(T2) where T is the number of traps). Only the lower triangle and diagonal of the symmetrical Rijpipj matrix need be evaluated.

Initial detection magnitude g0S

A similar but faster method is used to obtain g0S. Given a value for σ, equation 2 may be used to estimate the 'naïve' probability that an animal is caught at some site

We observe the number of recaptures fi for each of the Mt+1 different animals caught. We can relate g0 to the mean number of recaptures within a trapping session, conditional on an animal having been caught once, here designated C:

This may be an unreliable indicator of g0 when there is a large 'learned trap response' (i.e. c << p or c >>p in the notation of Otis et al. 1978). However, it has the advantage of not requiring an estimate of N or D.

where t is the number of capture occasions and A is the area within which P>0.

The procedure is again to sample P from A and use numerical minimisation to find the value of g0 for which E(C) equals the observed C-bar, given σ, t and a trap layout.

Initial density DS

Estimates of g0S and σS are used to estimate the 'initial' effective sampling area esaS.

From the definition of esa (Borchers and Efford 2008) we then have DS = Mt+1 / esaS.


Trapping simulation algorithm

Algorithm for spatial simulation of animal trapping

Animals are assumed to occupy home ranges that are fixed for the duration of trapping, and traps are set at known locations. The probability Pij of an individual animal i being caught in a particular trap j declines with the distance d between its home-range centre and the trap. For simplicity the detection function is assumed here to be half-normal:

Pij = g0 exp (–dij2/ (2σ2) ), (1)

where g0 is the probability of capture when the trap is located exactly at the centre of the home range, and σ is a measure of home range size. We simulate a sequence of captures in continuous time. Where there are initially n animals and t empty traps, any of n.t different capture events may occur first and each possible combination is treated as a competing Poisson process. Time to first occurrence of a combination has an exponential distribution with rate parameter

λ = –log (1 – Pij). (2)

The algorithm for single-catch live traps (detectors) is then:

  1. Calculate λ for each animal+trap combination from eqns (1) and (2)
  2. Simulate the time to first capture for each combination by drawing a pseudorandom number from an exponential distribution with parameter λ
  3. Find the next capture (i.e. remaining animal+trap with minimum time to first capture)
  4. If time exceeds 1 then ignore this capture and return
  5. Record capture and remove all combinations involving this animal or this trap*
  6. If at least one animal and one trap remain, then go to 3, else return.

* For other detector types (code>1), animals and/or detectors may remain 'live'.


Random number generator

A choice of pseudorandom generators is offered (Options | General).

The default is the intrinsic function 'Random' provided with Borland Pascal in Delphi 6. This has period 232 and appears adequate for most purposes.

Alternatives are:

  • RAN3 (Press et al. 1989)
  • Mersenne Twister (Matsumoto & Nishimura 1998; see also Agner Fog web page)
  • RANROT W ( Agner Fog www.agner.org/random/theory/) *

For all generators the pseudorandom number stream may be controlled by setting the random seed on the Options form. If 'Auto' is selected or the seed box is left blank or contains the word 'System' then the seed will be set from the system clock.

The seed value is accessed to initiate a new random number stream only –

  • at start-up
  • at the start of simulation and inverse prediction ('GO' or 'GO All' buttons on the main form)
  • at the start of IP spot simulations (' GO' under 'Tools | IP Spot simulations' on the main form)
  • at the start of Monte Carlo simulations for ML SECR goodness-of-fit
  • at the start of resampling for bootstrap confidence limits on ML SECR detection parameters
  • at the start of simulations for power analysis ('GO' on the Simulation form)
  • when Tools | Preview is clicked in Simulation
See also : Test random number generator

TIP: If you set the random seed directly (the default) then you can expect the same simulations each time. This may have undesirable consequences.

References


Habitat mask

What is a habitat mask?

Many field study sites include or adjoin areas of non-habitat where it is known that animals do not live. DENSITY (IP SECR or ML SECR) fits a spatial model of animal locations (home range centres). A meaningful model explicitly excludes non-habitat from the area in which animals are assumed to live. For this we need a map of the habitat areas, called a 'habitat mask' in DENSITY.

A mask will usually be constructed in a geographic information system (GIS). DENSITY recognises two input formats:

  • ESRI polygon shapefile (.shp)
  • Text file of polygon vertices

Polygons are assumed to use the same cartesian coordinate system as trap locations. Polygons must all be either habitat or non-habitat (see Options | Habitat mask). No mechanism is provided for selecting among polygons. The mask will be clipped automatically to the current buffer width. Areas outside the mask but inside the buffer width are classified as habitat or non-habitat depending on the setting in Options | Habitat mask. Trap sites outside a mask are generally discarded, but this may be changed in Options | Habitat mask.

WARNING: If input is from a shapefile then DENSITY expects the entire mask to be contained within one record (feature), although this may comprise multiple polygons. You can use the Dissolve function in ArcGIS to merge polygons from multiple features.

TIP: Studies within a rectangular fence equidistant from the outermost traps in the cardinal directions (e.g. Parmenter et al. 2003) do not require a mask. They may be simulated by setting an appropriate buffer width.

TIP: Having previewed a shapefile mask in Options | Habitat mask you can save it as a text mask; right-click on the preview.

TIP: ML SECR uses a mesh of points for 2-D integration. Rather than apply a complex habitat mask you may import a customized mesh from which non-habitat points have been deleted. Mesh import overrides any habitat mask. See Options | Computation.

References


System requirements

DENSITY runs on systems with Windows XP, Vista and Windows 7. Windows 8 is an unknown. The program occupies about 8Mb of disk space.

DENSITY assumes a minimum screen size of 1024 x 768 pixels. At lower resolution you will not see important parts of the screen.

The exact memory requirements of DENSITY have not been determined, but it can be memory demanding. You should probably have at least 100Mb of free RAM.


Files created by DENSITY

All are text files suitable for viewing with a text editor (Notepad or better).

Type | Default name or extension
DENSITY project files | *.den
Simulator project files | *.dpa
Log file | density4.log
Analysis output file | density4.out
Export files from various options in Tools menu | *.txt
Exported capture histories in MARK format | *.inp
Trap layout saved from Trap builder | *.txt
Names of recently opened DENSITY parameter files* | density.cfg
Bug reports accumulated by user* | bugreport.txt
Simulation report | PAreport.txt
Simulation exported capture data | PACaptures.txt
* Saved in same folder as density5.exe

Various other temporary files are created for input to CAPTURE and R, or as output from those programs.


Program limits

Last updated 2012-11-30

Variable | Maximum | Notes
Number of trap sites | 1700 |
Number of distinct animals | 50000 | Also used as upper limit for MLE Nhat
Number of captures | 100000 |
Number of captures per session | 20000 |
Number of occasions (days) per session | 150 |
Number of sessions | 200 |
Number of individual covariates in input | 10 |
Number of terms in Huggins model | 5 |
Number of session covariates (ML SECR) | 5 |
Number of occasion covariates (ML SECR) | 5 |
Simulator - Number of replicates | 10000 |
Simulator - Number of different groups | 20 |
Number of Pxy contour levels | 256 |
Session identifier | 17 characters |
Animal identifier | 17 characters | 2 digits + '.' required for unique ID when pooling sessions; effective max is then 14 characters
Trap identifier | 17 characters |

Other settings

Variable | Values
Field delimiters for input text files | space, comma, tab
Comment symbols | semicolon (;) hash (#)
Default grid for evaluation of Pxy contours | 128 x 128
Default mesh for 2-D integration | 64 x 64


Software

Known bugs
List of program files
GNU General Public License
 Source code acknowledgements


Changes in DENSITY 5.0

A new tool button on the main form starts an interface to the R package secr. This translates the current data entry, data filters and model specification into R code. The code is optionally submitted to R in batch mode, and results are displayed in DENSITY.

Also,
  • The default capture format has changed from XY to TrapID.
  • The PowerAnalysis module has been renamed Simulator, and this is more fully documented.
  • The Animals and Pxy contour toolbuttons on the main form use parameter values from a panel displayed whenever they are called, instead of values from Options | IP SECR.
  • A Monte Carlo test for non-independence of trap-revealed locations has been reinstated from a previous version of DENSITY.
  • Various popup menus and selectors on the main form have been tweaked or relocated for better performance.
  • Capture details for a selected animal or point are displayed in a floating window rather than a panel at the bottom right of the main form.
  • Cycling over animals may be interrupted by clicking on the map.
  • The main form displays the current buffered area ('Mesh') on the status bar even when no mask is in use.
  • Mesh points further than the buffer distance from any trap are now discarded by default (see Options | Computation Trap buffer).
  • IP SECR and the ShowAnimals tool button now respect habitat defined with an imported mesh
  • ML SECR now reports the expected population size in the masked area (MLEN).
  • ML SECR automatically transfers estimates to Tools | ML SECR log likelihood.
  • 'z' notation is used throughout for shape parameter of hazard-rate detection function in preference to 'b' or 'hazz'.
Many rarely-used, incomplete or deprecated features have been removed. These include
  • DISTANCE interface (see Distance web page)
  • Binomial N-mixture and Double-observer N estimation (see R package unmarked)
  • Artificial cover objects
  • Area live and Area kill detector types (see polygon detector type in R package secr)
  • Windows priority setting (use the Windows Task Manager Ctrl-Alt-Del)

TIP: If you absolutely need any of these you can find an old version of DENSITY at www.otago.ac.nz/density.

Bugs fixed:

  • SE of derived (Horvitz-Thompson) estimate of density misreported (lacked encounter-rate component)
  • Options | Output field selector not working
  • In the simulator, resampling of a capture file failed with a numeric error
  • In Data | Import | Capture histories removals miscoded for occasions before last
  • Some memory leaks have been fixed so 'Out of memory' problems are less likely
  • ML SECR could fail with conditional likelihood and between-session models when number of animals detected declined over time
  • Occasion, trap and individual covariates were standardised using the within-session mean and SD, which could be misleading in multi-session models
  • 'Simulate one sample' ShowAnimals tool button popup option was not working
  • Minor interface malfunctions: 'One occasion at a time' map display did not apply to selected animal; 'Traps as dots' not working with proximity detectors; ML contour P(wi|X) did not scroll with animal selector.

The program has been ported from Borland Delphi 6 to a much more recent version of the Object Pascal compiler, Delphi XE2.

References


Known bugs

Known bugs and deficiencies

Last updated 2012-12-04

ML SECR does not allow the user to set initial values for the ancillary parameters of a 'between-session' model (e.g. slope of a trend line), nor are profile likelihood intervals calculated for estimates of these parameters.

ML SECR within-session covariate models (time, individual, trap) can be misleading for multiple sessions because covariates are scaled independently to have zero mean and unit SD within each session.

ML SECR omits the names, link functions and initial values of between-session ancillary parameters from the parameter string reported in the 'numerical options' header (also used by Tools | ML SECR log likelihood).

Occasionally, output values may be too large for the allocated space, causing them to flow together. Please report this so it can be fixed.

See also : Program limits


List of source files etc

DENSITY 5 program files

DENSITY 5 is a Delphi XE2 application comprising the following files.

Application source

density5.dpr
density5.res

Application executable files

density5.exe
density5.chm Compiled HTML help system

Forms (each requires .dfm and .pas file)
about1 | About box (version number etc)
captureviewer | Details of captures selected on the main form map
cmap1 | Contour plot of SECR log likelihood
density1 | Main form
dmod1 | Data module - file dialogs, image list etc.
llevaluate | Spot evaluation of SECR log likelihood
maketrap | Trap builder
Monteca1 | Monte Carlo movement tests
options1 | Options
PAhist1 | Histograms of simulation results
photoviewer | Display images on main form
pmap1 | Screen plots (uses geograph component)
power1 | Simulation
rform1 | R interface
spotd | Spot density estimates using effective trapping area
spotsim | Spot simulations viewer
testrandom1 | Test random number generators
trapmap1 | Simulator trap map
viewer | Text file viewer
Units
datamodification.pas | Data transformations, mostly for Data menu on main form
filelist1.pas | Manage list of recently opened files
gcont1.pas | Contouring algorithm for Pxy etc.
globals.pas | Global declarations
habmask2.pas | Habitat mask and integration mesh
huggins.pas | Huggins / Alho logit linear models
input1.pas | Input routines
matrix.pas | Utilities for matrix arithmetic in inverse prediction. (Probably could substitute DMath calls).
maxlik1.pas | Code for ML spatially explicit model
openpop1.pas | Open population analyses
output1.pas | Main output routines and field definitions
plots.pas | Screen plots of distributions, profile likelihood etc.
popest.pas | Population estimators
popn.pas | Simulate home range centres for IP SECR and graphic display
poweroutput1.pas | Output routines for Simulator, including field definitions
quadpck1.pas | Translation of some QUADPACK code for 1-D numerical integration
recipes.pas | Algorithm for nonlinear least squares from Press et al
rpversioninfo.pas | Versioning component from Rick Peterson rickpet@airmail.net
search1.pas | Inverse prediction algorithm
shapetypes.pas | Declarations for GIS shapefiles and Tboundary and Troute objects
simdata.pas | Simulations for Monte Carlo tests
simmgr.pas | Manage parameter settings for simulations in Simulator
simplex.pas | Minimisation algorithm for Mh2 estimator
TESmgr.pas | Manage trapping and estimation settings in Simulator
transform.pas | Transformations for inverse prediction (needs revision)
traps.pas | Trap location object
tsproc2.pas | Trapping simulator for Simulator
tsproc4.pas | Trapping simulator for inverse prediction search
utils.pas | Functions for data manipulation, random numbers etc.
Included code
powerheader.pas For simulation output (poweroutput1.pas)
Custom visual components
densitypoly.pas | poly1 overlay object
geograph.pas | tgeograph object
mgevcl.pas | valuelist object
densitypack.dpk | Package containing above files
densitypack.bpl | Package containing above files
Random number generators of Fog 2001
ranlib.pas | Interface to random number functions of Fog 2001
mersenna.obj | Object code for Mersenne Twister
ranrot.obj | Object code for RANROT W etc.
DMath Pascal code of Jean Debord
fmath.pas | Math functions
fspec.pas | Special functions (lngamma)
matrices.pas | Vector and matrix operations with dynamics arrays
optim.pas | Golden search for a function of one variable Simplex, Marquardt, BFGS for a function of several variables
HTML Help |
density5.hhp | HTML help workshop project file
density5.hhk | Index file
density5.hhc | Contents file
Graphics |
density5.ico | Main DENSITY 5 icon
density5PA.ico | Simulation icon
WOTH 28 06 05 small.jpg | Photo for About.dfm


GNU GENERAL PUBLIC LICENSE

Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place - Suite 330, Boston, MA  02111-1307, USA

TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.

1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.

You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.

2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:

  • a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.

  • b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.

  • c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.

In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.

3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:

  • a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
  • b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
  • c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.

If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.

4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.

5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.

6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.

7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, wDENSITYhich is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.

This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.

8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.

9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.

10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.


Acknowledgements

Acknowledgments

David Borchers of St Andrews University contributed most of the theory for fitting SECR models by maximum-likelihood. Vickie Bakker, Deanna Dawson, Ed Debevec, Rachel Fewster, David Fletcher, Eric Howe, Adrian Monks, Dave Ramsey, Juan Reppucci, Eric Rexstad, James Russell, Phil Seddon, Deb Wilson, and other users gave friendly support and suggestions. Deanna Dawson edited parts of the help file. Thanks!

Thanks also to the many people who have provided interesting datasets, including my co-authors Andrea Byrom, Grant Norbury and Chan Robbins. Bob Parmenter generously provided the raw data for his 2003 trapping web paper.

The original code for simulation and inverse prediction (IP SECR) owes a lot to Shirley Pledger and Andrew Tokeley, and some of the original coding of DENSITY was done while I was employed by Landcare Research. Anne Chao generously shared the source code for calculating her sample coverage estimators. See here for other code acknowledgments.

Murray Efford

10 December 2012


Recommended citation

Efford MG 2012. DENSITY 5.0: software for spatially explicit capture–recapture. Department of Mathematics and Statistics, University of Otago, Dunedin, New Zealand. http://www.otago.ac.nz/density.


References

Alho JM 1990. Logistic regression in capture–recapture models. Biometrics 46: 623–635.

Anderson DR, Burnham KP, White GC 1994. AIC model selection in overdispersed capture–recapture data. Ecology 75: 1780–1793.

Anderson DR, Burnham KP, White GC, Otis DL1983. Density estimation of small-mammal populations using a trapping web and distance sampling methods. Ecology 64: 674–680.

Barker RJ, Warburton B, Coleman M, MacKenzie DI 2002. Assessing brushtail possum densities using a trapping web. Submitted

Borchers DL, Buckland ST, Zucchini W 2002. Estimating animal abundance: closed populations. Springer, London.

Borchers DL, Efford MG 2007. Supplements to Biometrics paper. Available online at www.otago.ac.nz/density

Borchers DL, Efford MG 2008. Spatially explicit maximum likelihood methods for capture–recapture studies. Biometrics 64: 377–385.

Brown PJ 1982. Multivariate calibration. Journal of the Royal Statistical Society, Series B, 44: 287–321.

Buckland ST 1987. On the variable circular plot method of estimating animal density. Biometrics 43: 363–384.

Buckland ST, Anderson DR, Burnham KP, Laake JL 1993. Distance sampling: estimating abundance of biological populations. Chapman & Hall, London.

Buckland ST, Anderson DR, Burnham KP, Laake JL, Borchers DL, Thomas L 2001. Introduction to distance sampling. Oxford University Press, London.

Buckland ST, Anderson DR, Burnham KP, Laake JL, Borchers DL Thomas L 2004. Advanced distance sampling: estimating abundance of biological populations. Oxford University Press, Oxford.

Burnham KP, Anderson DR, White GC, Brownie C, Pollock KH 1987. Design and analysis methods for fish survival experiments based on release–recapture. American Fisheries Society Monograph 5. Bethesda, Maryland, USA.

Burnham KP, Overton WS 1978. Estimating the size of a closed population when capture probabilities vary among animals. Biometrika 65: 625–633.

Carothers AD 1979. Quantifying unequal catchability and its effect on survival estimates in an actual population. Journal of Animal Ecology 48: 863–869.

Chao A 1987. Estimating the population size for capture-recapture data with unequal catchability. Biometrics 43: 783–791.

Chao A 1988. Estimating animal abundance with capture frequency data. Journal of Wildlife Management 52: 295–300.

Chao A, Huggins RM 2005a. Classical closed population models. In: Amstrup SC, McDonald TL, Manly BFJ (eds) Handbook of capture–recapture methods. Princeton University Press, 22–35.

Chao A, Huggins RM 2005b. Modern closed population models. In: Amstrup SC, McDonald TL, Manly BFJ (eds) Handbook of capture–recapture methods. Princeton University Press, pp 58–87.

Chao A, Lee S-M, Jeng S-L 1992. Estimating population size for capture-recapture data when capture probabilities vary by time and individual animal. Biometrics 48: 201–216.

Cooch E, White GC 2012. Program MARK: A gentle introduction. 11th edition. www.phidot.org/software/mark/docs/book/

Dice L 1938. Some census methods for mammals. Journal of Wildlife Management 2: 119–130.

Diggle PJ 1983. Statistical analysis of spatial point patterns. Academic Press, London.

Dixon P M 2002. Bootstrap resampling. In: A. H. El-Shaarawi and W. W. Piegorsch (eds) Encyclopedia of Environmetrics. John Wiley and Sons, Chichester. Pp. 212–220.

Dorazio RM, Royle JA 2003. Mixture models for estimating the size of a closed population when capture rates vary among individuals. Biometrics 59: 351–364.

Eberhardt LL 1990. Using radio-telemetry for mark–recapture studies with edge effects. Journal of Applied Ecology 27: 259–271.

Efford MG 1998. Demographic consequences of sex-biased dispersal in a population of brushtail possums. Journal of Animal Ecology 67: 503–517.

Efford MG 2004. Density estimation in live-trapping studies. Oikos 106: 598–610.

Efford MG 2005. Migrating birds stop over longer than usually thought: Comment. Ecology 86: 3415–3418.

Efford MG 2011. Estimation of population density by spatially explicit capture-recapture analysis of data from area searches. Ecology 92: 2202–2207.

Efford MG, Borchers DL, Byrom AE 2009. Density estimation by spatially explicit capture-recapture: likelihood-based methods. Pp. 255–269. In: DL Thomson, EG Cooch, MJ Conroy (eds) Modeling Demographic Processes in Marked Populations. Springer, New York.

Efford MG, Dawson DK, Borchers DL 2009. Population density estimated from locations of individuals on a passive detector array. Ecology 90: 2676–2682.

Efford MG, Fewster RM 2012. Estimating population size by spatially explicit capture-recapture. Oikos http://dx.doi.org/10.1111/j.1600-0706.2012.20440.x

Efford MG, Cowan PE 2004. Long-term population trend of Trichosurus vulpecula in the Orongorongo Valley, New Zealand. In: Goldingay RL, Jackson SM (eds.) The Biology of Australian Possums and Gliders. Surrey Beatty & Sons, Chipping Norton. Pp. 471–483.

Efford MG, Dawson DK 2012. Occupancy in continuous habitat. Ecosphere 3(4):32. http://dx.doi.org/10.1890/ES11-00308.1

Efford MG, Dawson DK, Robbins CS 2004. DENSITY: software for analysing capture-recapture data from passive detector arrays. Animal Biodiversity and Conservation 27.1: 217–228.

Efford MG, Warburton B, Coleman MC, Barker RJ 2005. A field test of two methods for density estimation. Wildlife Society Bulletin 33: 731–738.

Fog A 2001. Chaotic random number generators with random cycle lengths. www.agner.org/random/theory Revised version November 25, 2001.

Franklin AB 2001. Exploring ecological relationships in survival and estimating rates of population change using Program MARK. In: Field R, Warren RJ, Okarma H, Sievert PR (eds) Wildlife, land and people: priorities for the 21st century. The Wildlife Society, Bethesda, Maryland USA.

Frederic P, Lad F 2003. A technical note on the logitnormal distribution. Research report 2003/7. University of Canterbury Department of Mathematics and Statistics. www.math.canterbury.ac.nz/php/research/abstracts/abstract(2003-7).php Accessed 27/11/04.

Genz AC, Malik AA 1980. Remarks on algorithm 006 : An adaptive algorithm for numerical integration over an N-dimensional rectangular region''. Journal of Computational and Applied Mathematics 6: 295–302.

Grant TJ, Doherty PF 2007. Monitoring of the flat-tailed horned lizard with methods incorporating detection probability. Journal of Wildlife Management 71: 1050–1056.

Gurnell J, Gipps JHW 1989. Inter-trap movement and estimating rodent densities. Journal of Zoology (Lond.) 217: 241–254.

Huggins RM 1989. On the statistical analysis of capture experiments. Biometrika 76: 133–140.

Huggins RM 1991. Some practical aspects of a conditional likelihood approach to capture experiments. Biometrics 47: 725–732.

Huggins R 2001. A note on the difficulties associated with the analysis of capture–recapture experiments with heterogeneous capture probabilities. Statistics and Probability Letters 54: 147–152.

Jett DA, Nichols JD 1987. A field comparison of nested grid and trapping web density estimators. Journal of Mammalogy 68: 888–892.

Johnson NL, Kotz S 1970. Continuous univariate distributions. Houghton Mifflin, Boston.

Kennedy WJ, Gentle JE 1980. Statistical computing. Marcel Dekker, New York.

Khuri AI, Cornell JA 1987. Response surfaces. Designs and analyses. Marcel Dekker, New York.

Lebreton J-D, Burnham KP, Clobert J, Anderson DR 1992. Modeling survival and testing biological hypotheses using marked animals: a unified approach with case studies. Ecological Monographs 62: 67–118.

Lee S-M, Chao A 1994. Estimating population size via sample coverage for closed capture-recapture models. Biometrics 50: 88–97.

Link WA, Barker RJ 1994. Density estimation using the trapping web design: a geometric analysis. Biometrics 50: 733–745.

Lukacs PM 2002. WebSim: simulation software to assist in trapping web design. Wildlife Society Bulletin 30: 1259–1261.

Luckacs P, Franklin AB, Anderson DR 2004. Passive approaches to detection in distance sampling. In: Buckland ST, Anderson DR, Burnham KP, Laake JL, Borchers DL, Thomas L, editors. Advanced distance sampling. Oxford University Press, Oxford.

MacKenzie DI, Nichols JD, Lachman GB, Droege S, Royle JA, Langtimm CA 2002. Estimating site occupancy rates when detection probabilities are less than one. Ecology 83: 2248-2255.

MacKenzie DI, Nichols JD, Royle JA, Pollock KH, Bailey LL, Hines JE. 2005. Occupancy estimation and modeling: inferring patterns and dynamics of species occurrence. Academic Press.

Manly BFJ 1997. Randomization, bootstrap and Monte Carlo methods in biology. 2nd edition. Chapman and Hall, London.

McDonald T 2004. GRTS for the Average Joe: A GRTS Sampler for Windows. www.west-inc.com/computer.php Accessed 22/12/06.

Manske M, Schwarz CJ 2000. Estimates of stream residence time and escapement based on capture-recapture data. Canadian Journal of Fisheries and Aquatic Sciences 57, 241–246.

Marques TA, Thomas L, Royle JA 2011. A hierarchical model for spatial capture–recapture data: comment. Ecology 92: 526–528.

Matsumoto M, Nishimura T 1998. Mersenne Twister: a 623-dimensionally equidistributed uniform pseudo-random number generator. ACM Transactions in Modelling and Computer Simulation 8: 3–30.

Nelder JA, Mead R 1964. A simplex method for function minimization. Computer Journal 7: 308–313.

Nichols JD, Pollock KH, Hines JE 1984. The use of a robust capture-recapture design in small mammal population studies. Journal of Mammalogy 64: 253–260.

Nichols JD, Hines JE 2002. Approaches for the direct estimation of λ, and demographic contributions to λ, using capture-recapture data. Journal of Applied Statistics 29: 539–568.

Nichols, J.D., J.E. Hines, J.R. Sauer, F.W. Fallon, J.E. Fallon, and P.J. Heglund. 2000. A double-observer approach for estimating detection probability and abundance from point counts. The Auk 117: 393–408

Noon BR, Sauer JR 1990. Population models for passerine birds: structure, parameterization, and analysis. In: McCullough DR, Barrett RH (eds) Wildlife 2001: populations. Elsevier Applied Science, London. Pp. 441–464.

Norbury G, Efford MG 2004. Ferret density estimation. Unpublished Landcare Research Contract Report LC0304/110, prepared for the Animal Health Board, Wellington.

Otis DL, Burnham KP, White GC, Anderson DR 1978. Statistical inference from capture data on closed animal populations. Wildlife Monographs No. 62.

Parmenter RR, Yates TL, Anderson DR, Burnham KP, Dunnum JL, Franklin AB, Friggens MT, Lubow BC, Miller M, Olson GS, Parmenter CA, Pollard J, Rexstad E, Shenk TM, Stanley TR, White GC 2003. Small-mammal density estimation: A field comparison of grid-based vs. web-based density estimators. Ecological Monographs 73: 1–26.

Piessens R, de Doncker-Kapenger E, Ueberhuber CW, Kahaner DK 1983. QUADPACK, a subroutine package for automatic integration. Springer Verlag.

Pledger S 2000. Unified maximum likelihood estimates for closed capture-recapture models using mixtures. Biometrics 56: 434–442.

Pledger S et al. In press. Environmental and Ecological Statistics.

Pledger S, Efford M 1998. Correction of bias due to heterogeneous capture probability in capture-recapture studies of open populations. Biometrics 54: 888–898.

Pollock KH 1982. A capture-recapture design robust to unequal probability of capture. Journal of Wildlife Management 46: 752–757.

Pollock KH, Nichols JD, Brownie C, Hines JE 1990. Statistical inference for capture-recapture experiments. Wildlife Monographs No. 107.

Pradel R 1996. Utilization of capture-mark-recapture for the study of recruitment and population growth rate. Biometrics 52: 703–709.

Press WH, Flannery BP, Teukolsky SA, Vetterling WT 1989. Numerical recipes in Pascal: the art of scientific computing. Cambridge University Press, Cambridge UK. 759 p.

R Core Team 2012. R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. http://www.R-project.org/.

Rexstad E, Burnham K 1991. User's guide for interactive program CAPTURE. Colorado Cooperative Fish and Wildlife Research Unit, Fort Collins CO.

Ripley BD 1987. Stochastic simulation. John Wiley & Sons.

Robinson I, Hill M 2002. Algorithm 816: r2d2lri: An algorithm for automatic two-dimensional cubature. ACM Transactions on Mathematical Software 28: 75–100.

Royle JA 2004. N-mixture models for estimating population size from spatially replicated counts. Biometrics 60: 108–115

Sandland RL, Cormack RM 1984. Statistical inference for Poisson and multinomial models for capture–recapture experiments. Biometrika 71: 27–33.

Schaub M, Pradel R, Jenni L, Lebreton J-D 2001. Migrating birds stopover longer than usually thought: an improved capture–recapture analysis. Ecology 82: 852–859.

Schwarz CJ, Arnason AN 1996. A general methodology for the analysis of capture-recapture experiments in open populations. Biometrics 52: 860–873.

Seber GAF 1982. The estimation of animal abundance and related parameters. 2nd ed. Charles Griffin, London.

Skalski JR, Robson DS, Simmons MA 1983. Comparative census procedures using single mark–recapture methods. Ecology 64: 752–760.

Skalski JR, Simmons MA, Robson DS 1984. The use of removal sampling in comparative censuses. Ecology 65: 1006–1015.

Snyder WV 1978. Algorithm 531: Contour plotting. ACM Transactions in Mathematical Software (TOMS) 4: 290–294.

Stamm DD, Davis DE, Robbins CS 1960. A method of studying wild bird populations by mist-netting and banding. Bird-Banding 31: 115–130.

Stanley TR, Burnham KP 1998. Information-theoretic model selection and model averaging for closed-population capture-recapture studies. Biometrical Journal 40: 475–494.

Stevens DL Jr, Olsen AR 2004. Spatially balanced sampling of natural resources. Journal of the American Statistical Association 99: 262–278.

Swihart RF, Slade NA 1985. Testing for independence of observations in animal movements. Ecology 66: 1176–1184.

Swihart RF, Slade NA 1987. A test for independence of movements as shown by live trapping. American Midland Naturalist 117: 204–207.

Thomas L, Laake JL, Strindberg S, Marques FFC, Buckland ST, Borchers DL, Anderson DR, Burnham KP, Hedley SL, Pollard JH 2002. Distance 4.0. Release 2. Research Unit for Wildlife Population Assessment, University of St. Andrews, St. Andrews, UK. http://www.ruwpa.stand.ac.uk/distance/. Accessed 14 February 2003.

White GC 2002. Discussion comments on: the use of auxiliary variables in capture- recapture modelling. An overview. Journal of Applied Statistics 29: 103–106.

White GC 2005. Correcting wildlife counts using detection probabilities. Wildlife Research 32: 211–216.

White GC, Anderson DR, Burnham KP, Otis DL 1982. Capture-recapture and removal methods for sampling closed populations. Los Alamos National Laboratory, Los Alamos, New Mexico.

White GC, Shenk TM 2001. Population estimation with radio-marked animals. In: Millspaugh JJ, Marzluff JM (eds) Radio-tracking and animal populations. Academic Press, San Diego, California, USA. Pp 346–350.

Williams BK, Nichols JD, Conroy MJ 2002. Analysis and management of animal populations. Academic Press, San Diego.

Wilson KR, Anderson DJ 1985. Evaluation of two density estimators of small mammal population size. Journal of Mammalogy 66: 13–21.

Yamada I, Rogerson PA 2003. An empirical comparison of edge effect correction methods applied to K-function analysis. Geographical Analysis 35: 97–109


Allow recaptures

Allow recaptures within an occasion

Within-occasion recaptures are usually rejected as duplicates. Tick this box if you want to include them. Some detection models entertain the possibility that an individual may yield valid data (capture locations) twice or more on one day (occasion). For this it is necessary to sneak the data past the check in 'Read data' that sees duplicate records as data errors.

'Allow recaptures' is the default when the detector type is 'Proximity' in the trap layout box.


Analysis groups

Some analyses are performed immediately data are loaded, but most wait until you click 'GO' or 'GO all' ('GO all' is used run analyses for multiple sessions). These analyses fall into major groups that may be selected or deselected on the main screen. The two-letter prefix is also used to distinguish output fields relating to different analyses. Each analysis group has a corresponding Options page that may be accessed with the adjacent button.

CP Closed population | Conventional closed population analyses, within-session movement statistics, and some extras such as repeated count models (Royle 2004) and density estimation from combined trapping and telemetry data (White & Shenk 2001; M Efford unpubl.).
IP SECR | Spatially explicit capture-recapture estimation using simulation and inverse prediction (Efford 2004, Efford, Dawson & Robbins 2004)
ML SECR | Likelihood-based spatially explicit capture-recapture models (Borchers & Efford 2008; Efford, Borchers & Byrom 2009)
OP Open population | Jolly-Seber (JS), Cormack-Jolly-Seber (CJS) and reversed CJS estimates for populations sampled over time. Parameters estimated include population size (JS), survival probability (CJS) and finite population growth rate.

References


Auto legend

This option adds a legend defining the output fields to the output file after each analysis. You may not need this once you get to know the abbreviated field names.

TIP: A legend may be added at any time with 'Tools | Append legend to output".


Background image

An image may be used instead of the plain default background to the map of traps and captures. Select an image file in Options | Graphics; jpg, bmp and wmf formats are allowed. Supply the coordinates of the top, bottom, left and right edges of the image. These are used solely to locate the image in relation to the traps: the extent of the map is determined by the trap layout and the buffer width.

Display of the background image may toggled on or off via the map popup menu (right-click on map).

TIP: Images from Google Earth will do at a pinch, but it can be difficult to get precise edge coordinates. You may also have to convert between coordinate systems. If you don't have suitable GIS software, use the free software DNRGPS (previously DNRGarmin) for projecting latitude and longitude to a chosen coordinate system.


Beep on completion

No help available ;-)


Buffer spin increment

Set the increment in buffer width associated with one click of the 'Buffer width' spin edit. Useful if you switch area units (the default increment of 10 m is tediously slow when the buffer is measured in kilometres).


CAPTURE interface

Closed-population analyses with CAPTURE

DENSITY provides a simple interface to the classic CAPTURE software (Otis et al. 1978).

To use the interface, first

  • Obtain a copy of CAPTURE (capture.exe) from www.mbr-pwrc.usgs.gov/software.html
  • Enter the location of capture.exe in Options | Closed N

A CAPTURE page appears among the session summaries on the main form. Add analysis tasks for the current trapping session to the window on this page (right-click for a menu of common tasks). DENSITY takes care of serving its data up to CAPTURE in the correct format. Just click RUN and view the output.

Unless you tick 'Append', the temporary output file will be overwritten at each analysis. Use File | Save in the output viewer to save under a different name.

TIP: CAPTURE has some limitations that will cause it to fail with medium to large datasets and with very long file names.

References


Capture filter

The capture filter has the limited purpose of allowing some records in the capture file to be omitted from analyses on the basis of any text (codes, notes or covariates) that follows the required fields (capture data).

Input is limited to records that contain the text of the filter.
e.g. The filter 'REVI' restricts analysis to records such as...

66 67000601 1 21 REVI

and drops others such as...

66 65104034 1 31 WOTH.

The ! operator excludes records.
e.g. the capture filter !WOTH would drop wood thrushes from the analysis.

Numeric capture filters are new in version 4. If the first non-blank character of the filter is '<', '>' or '=' then next field is interpreted as a number and the captures restricted accordingly. For example, the filter '>5' restricts the input data set to captures with values greater than 5 at the start of the Notes field (5.1, 20, 999 etc.).

TIP: After 'Read data', check the Summary tab to verify the filter has the effect you intended.

No selection occurs when the filter is blank or 'ALL'.


Closed population estimates

'Closed population estimates' refers to nonspatial estimates of population size (N) and related parameters for populations sampled over a period short enough for turnover (births, deaths, immigration and emigration) to be ignored. The key reference is Otis et al. (1978) and the standard software for many years was program CAPTURE.

DENSITY routinely displays a closed population estimate for each session when data are read (see Session statistics). Results may also be tabulated in the Output file along with the results of other analyses by ticking 'CP Closed population' and clicking 'GO'. The population estimate N-hat and associated estimate of capture probability p-hat play a special role as predictors in IP SECR.

References


Code acknowledgements

Source code used in DENSITY

Density contains Pascal code from various public sources. We thank these authors, and apologise to any who have been overlooked:

Jean Debord's DMath library
www.unilim.fr/pages_perso/jean.debord/tpmath/tpmath.htm
Accessed 27/11/07

Press et al. 1989 Numerical recipes
archives.math.utk.edu/software/msdos/numerical.analysis
Accessed 27/11/07

Random number generators Agner Fog
www.agner.org/random/randoma.htm
Accessed 27/11/07

rpVersionInfo Rick Peterson
www.manualy.sk/uddf/pages/verinfo.htm
Accessed 26/11/04

1-D numerical integration
 QUADPACK (in part) Piessens et al. (1983)
(translated to Delphi Pascal from the original FORTRAN)

DENSITY also provides a partial interface to this freely available program :
Capture www.mbr-pwrc.usgs.gov/software.html

References


Collapse double tags

This data tool provides a simple way to transform a capture file with two animal ID columns to a capture file with only one ID column.

Initial format : SessionID AnimalID1 AnimalID2 [rest of line]
Final format : SessionID AnimalID* [rest of line]

DENSITY selects the lesser of the two ID values for each capture.

The need arises because capture files for DENSITY have only one ID column but animals are often double-tagged to minimise the effect of tag loss. Selecting the lesser ID value (AnimalID*) provides a unique (primary) identifier for the individual. This method is more robust than simply using the first column because the order of recording may be unreliable (e.g. left ear tag recorded in column for right ear).

Use the 'notag' code to indicate a missing tag (Options). When one tag has been lost, the program checks that the remaining tag is the lesser of the two originals. If not, the user is asked to confirm that the original 'lesser' tag should be substituted.

The user is prompted for the file name and asked to confirm an example before the file is rewritten.


Confidence intervals

At least six different methods are used to calculate confidence intervals in DENSITY. Confidence intervals appear (i) as an optional statistic output with analyses from the main form (ii) as specific output fields in output from Simulation. Empirical confidence intervals may also be obtained for any output variable from Simulation (the statistics P025, P975 are the 2.5th and 97.5th percentiles of the sampling distribution), given sufficient replicates (1000 or more).

Methods for obtaining the variance of capture-recapture estimates, particularly maximum likelihood estimates, are discussed by Borchers et al. (2002) and Williams et al. (2002 Appendix F). For models fitted by numerically maximising the likelihood, the estimated SE is the square root of the asymptotic variance from the information matrix.

Standard confidence intervals are 'Wald' intervals (± zα/2 SE where z is the standard normal deviate. Closed population size N has a lower bound of Mt+1 (the number actually seen), and a better interval is obtained by adding this to a lognormal interval for the number not seen. Sometimes other methods are available that we expect to have better coverage (i.e. close to the nominal value, usually 95%), especially with small samples. Default methods sometimes yield limits outside the range of permissable values (e.g., probabilities > 1), which can be avoided with the alternative methods.

Profile likelihood intervals are commonly advocated for maximum likelihood estimates (e.g. Lebreton et al. 1992), but their calculation can be time consuming. They are used routinely in DENSITY for ML closed-population estimators. The plot available on the MLE page of session statistics illustrates the principle:

The horizontal reference line represents a level 1.92 (= zα/22 / 2) below the maximum log-likelihood at which the ML estimate (85.7). The lower and upper limits (77, 149) are the points at which the likelihood curve cuts the reference line. The flatness of the curve makes the upper limit unclear. This is a sign the data are inadequate.

Logit-transformed intervals for the open-population parameters φ and γ follow naturally from the practice of transforming them for likelihood maximisation. The interval is asymmetrical and bounded by (0,1).

Bootstrap resampling of capture histories is a computer-intensive option used in DENSITY for open-population parameters and optionally for site occupancy and ML SECR. See Manly 1997 for a general account. Coverage of intervals from percentiles of the bootstrapped values can be poor. Coverage is improved by taking percentiles on the scale of the Studentized values - the Studentized bootstrap or 'bootstrap-t' method (Manly 1997).

Parameter | Estimator(s) | Field(s) | Method for CL (options)
Closed-population N | Maximum likelihood | Nhat | Profile likelihood
 | Other | Nhat | Lognormal (Wald)
Closed-population p |  | phat | None
Movement |  | RPSV | None
 |  | dbar | None (SE provided)
 |  | MMDM | None (SE provided)
 |  | ARL | None (SE provided)
Density | Ad hoc (ARL/2, MMDM/2) | WDens | Wald*
Density | IP SECR | IPDens | Wald*
" | IP SECR | IPAdj | Wald*
g(0) | IP SECR | IPg0 | Wald*
σ | IP SECR | IPSigma | Wald*
Density | ML SECR | MLDens | Wald* (Profile likelihood)
All other within-session parameters | ML SECR | MLg0, MLSigma etc. | Wald* (Profile likelihood, bootstrap)
Deviance for ML GOF test | ML SECR | MLDev | Empirical (Monte Carlo - see Options | ML SECR | Advanced for number of replicate samples)
Jolly-Seber N | Direct | NJS, Phi, pJS, Gamma | Studentized bootstrap (Wald, Bootstrap)
Recruitment | Direct J-S | BJS | Studentized bootstrap (Wald, Bootstrap)
 | Robust design | RobustB | None (SE provided)
Cormack-Jolly-Seber φ, p | CJS likelihood | Phi, pJS | Studentized bootstrap (Wald*, Bootstrap)
Pradel φ, p and γ | Pradel γ likelihood | Phi, pJS, Gamma | Studentized bootstrap (Wald*, Bootstrap)
Population growth rate λ | Jolly-Seber or Pradel | Lambda | Studentized bootstrap (Wald, Bootstrap)
 | N(t+1)/N(t) | LambdaK | None (SE provided)

* Symmetric intervals are obtained on the link scale; these become asymmetric when back-transformed (excludes closed-form Jolly-Seber estimates).

References


Confidence ellipses

SECR confidence ellipses

Parameters estimated by SECR (e.g. D, g 0, σ) typically have non-zero sampling covariance. The full covariance matrix is output to the log file. A good way to visualise the pairwise covariances is to plot joint confidence ellipses for two parameters at a time using 'Tools | IP SECR confidence ellipse' or 'Tools | ML SECR confidence ellipse' on the main menu. (Ellipses from IP SECR are technically 'prediction' ellipses, but the distinction doesn't seem to matter). Ellipses for ML SECR are based on the asymptotic variance-covariance matrix.

These menu items are enabled only after an IP SECR or ML SECR analysis has estimated the relevant variance-covariance matrix. A shortcut for ML SECR if you already know the parameter estimates but not their covariance is to use 'Tools | ML SECR log likelihood' with the 'SE' selected. The confidence level is set in Options | Output.

TIP: The 'ellipses' from 'Tools | ML SECR confidence ellipse' usually do not look elliptical because they have been back-transformed from the link scale.

For publication-quality plots use the output from 'Tools | Append to log | ML SECR ellipse' to reconstruct the ellipse in a graphics package. You can choose between using the formula of an ellipse or the computed x-y coordinates.

See also Options | Output, Options | Graphics


Confidence level

Options | Output - Confidence level %

This level is used for all* confidence intervals, whether based on asymptotic normality, profile likelihood or bootstrapping, and for confidence ellipses The corresponding alpha value is updated automatically.

* At least that's the intention: please report any inconsistencies..


CP Huggins-Alho conditional likelihood) estimates

Closed population estimates – Huggins conditional likelihood

The 'Huggins linear logit' estimator fits the closed population models of Huggins (1989, 1991) and Alho (1989). These allow individual covariates of detection probability, in combination with temporal and behavioural effects. DENSITY also provides for a 'Markov' behavioural response - capture probability depends on whether an individual was caught at the previous opportunity (coded 0/1 in variable Mij for animal i at time j). Derived parameters are also reported for the Markovian site occupancy model of Lettink & Efford (in prep).

Define your linear logit model using the 'Huggins' tab in Options | Closed N:

A 'time-specific' time effect is in effect the conventional model Mt (Darroch estimator). A 'time covariate' time effect models occasion-specific capture probabilities as a logit-linear function of some covariate (fill in the boxes).

Individual covariates are provided in the capture data file at the end of each record e.g.
capt covar

Covariates must be numeric and are provided at least once for each individual, but need not be repeated for every capture. Covariates are assumed to be permanent attributes of each animal (e.g. sex, but possibly also body size if study is not too long). Omit individuals for which you do not know the covariates (and possibly add the number to your estimate of N). Your capture file may include several individual covariates; select among them with the covariate filter (e.g. '2 4' to select columns 2 and 4 in the Notes field of the input, implicitly discarding columns 1 and 3). The mean and SD of each covariate are reported on the 'MLE(N)' tab.

The completed model is shown at the bottom of the Options page, for information only. The results should be waiting for you when you Exit and return to the main form. Detailed output from Huggins model fitting appears on the 'MLE (N)' tab of the main form.

Huggins output

The Huggins estimator cannot be used with inverse prediction (IP SECR).

References


Density from effective trapping area

Closed population estimates – Density from ETA

The conventional approach to calculating population density from trapping data is to divide the estimate of population size N by an estimate of the effective trapping area ETA (e.g. Otis et al. 1978). ETA is commonly estimated by adding a 'boundary strip' of width W to the trap geometry*, and hence the notation AW is also used for ETA.

Spatially explicit capture recapture eliminates the need for ETA (Efford 2004, Borchers & Efford 2008). Nevertheless, DENSITY provides methods for approximating W, and reports the resulting estimate of density (WDens). To calculate WDens, DENSITY uses the settings and options on the ETA density page of the main form.

A conventional estimator of W is half the mean maximum distance moved MMDM (Otis et al. 1978). MMDM is also the average observed range length (distance between the most extreme captures of an individual). By default, animals caught only once are excluded from these calculations; a higher threshold for the number of recaptures may be set in Options | Input | Trap-revealed movement.

The most rigorous method for W when there are enough data is probably that of Jett and Nichols (1987), who suggested setting W equal to half the asymptotic trap-revealed range length (ARL). To estimate ARL, a curve of the form y = ARL.(1 – exp(–b(x–1))) is fitted by nonlinear least squares (x is the number of captures, and y is the observed range length). See 'Plot range length' on the Movements tab.

Both ARL/2 and MMDM/2 are expected to be negatively biased estimates of W because observed home ranges are truncated at the edge of the grid. Some authors (e.g. Parmenter et al. 2003) have reported estimates using MMDM.

When the strip width W is estimated from data there will be an associated sampling error. The sampling error of the density estimate D-hat should include this source of uncertainty. Otis et al. (1978: 73) and Wilson & Anderson (1985) provide a formula for the variance of D-hat using a strip width based on MMDM/2. DENSITY uses this formula whenever the sampling variance of W-hat is known. (The standard error (SE) is the square root of the sampling variance).

The field WCode records the method used to estimate W (Manual, ARL/2, MMDM or MMDM/2).

* Conventionally, the boundary strip is applied to the convex hull (minimum convex polygon) of the trap sites (the 'convex' option in DENSITY), but it is slightly more realistic to buffer around individual traps (the 'concave' option in DENSITY).

See also Effective sampling area, ETA density calculator

WARNING: Versions of Density before 4.3 had a bug in the calculation of MMDM and ARL. Reported values were less than or equal to true values, and ETA density based on these statistics was therefore greater than or equal to the intended value.

References


Data management

These tools make permanent changes to files of text data:

  • Collapse double tags
  • Recode occasions
  • Recode detector type
  • Rotate traps.

The user is prompted for the file name and asked to confirm an example before the file is rewritten.


Data menu

Operations on data files

Read data | Load and display the current trap layout and capture data. (Duplicates 'Read data' tool button)
Data manipulation | Collapse double tags | Transform a capture file with two animal ID columns to a capture file with only one ID column by selecting the lesser of the two ID values for each capture. (Only capture files with one ID column are read by DENSITY). Useful when animals are double tagged and both tags are recorded but the order of recording is unreliable. more
 | Recode occasions | Increase the occasion number of all captures in a capture file by a constant amount. For example, adding 6 days to a file with occasions numbered 1-5 results in a file with occasions numbered 6-10. Useful for creating a combined file from two consecutive trapping periods. more
 | Recode detector type | Recode a trap layout file with trap-by-trap detector information; change all instances of a particular value of the integer detector code to another detector code. more
 | Rotate traps | Permanently generate new X-Y coordinates for trap sites by rotating by a given number of degrees around the centre defined by the mid-ranges of the x- and y- coordinates. Rotated trap layouts may lie better in the arena and reduce the burden of simulating animals far from any trap. The same effect may be achieved by rotating the trap array 'on the fly' - see Options | Input.
Import | Import XY capture data | Capture data in format SessionID AnimalID X1 Y1 X2 Y2... are converted to a format readable by DENSITY. more
 | Import capture histories | Nonspatial capture data are imported from a file in MARK format
 | Import site histories | Nonspatial site histories are imported from a specialised text file for occupancy analysis. more
Export filtered captures | Save capture data in the same format as input, but with current filtering (e.g. re-coded occasions)
Export capture histories | Capture data are exported in capture history format to a text file, possibly in the form required by MARK - see Export capture histories.
 | Current session (closed population)
 | Current session with trapID
 | All sessions (open population)
 | All sessions (robust design)
Export site histories | Site histories are exported to a text file. A site history for a trap site records the number of animals detected at the site on each successive occasion.


Debug message level

As you increase this setting from the default level (1) DENSITY will tend to produce more detailed and voluminous output in the log file. The extra output is usually of little value and is not documented. Use sparingly!

Message level is set to zero internally when DENSITY performs Monte Carlo simulations for the ML SECR goodness-of-fit test, and during bootstrap resampling. Iterations of ML SECR maximisation from the main screen are displayed in the progress box (one evaluation at a time, but it is possible to scroll back to previous evaluations). To save a permanent trace, right-click on the displayed values and select 'write to log'.

Context | Threshold | Report to log file
Binomial N-mixture (repeated counts) | >2 | Each iteration of maximisation
IP SECR | >2 | Parameters and predictors for each vertex during search
ML SECR | >1 | ['ML SECR numerical options' header in output file]
ML SECR | >0 | Full report of estimates
ML SECR | >1 | Sorted capture histories (not for proximity detector)
Open population | >2 | Each iteration of Schwarz & Arnason likelihood
Simulation | >1 | Message on failure of closed-population estimates
Simulation | >1 | Number of captures for each session in each replicate
Simulation resampling | >1 | Numbers of captures and animals reported to log after each stage of resampling (population, TES filter)
Simulation IP SECR | >0 | Vertices of each box during search
Simulation IP SECR | >2 | Parameters and predictors for each vertex during search
Simulation IP SECR | >0 | Working solution at completion of simulations for each box
Simulation IP SECR | >1 | Message on failure of IP SECR
Simulation ML SECR | >1 | Each iteration of maximisation
Simulation Open population | >2 | True survival rate for each replicate
Simulation Open population | >1 | Detailed report in log file for each replicate
Simulation Open population | >1 | Mean m-array reported in log file


Default confidence intervals

Confidence intervals for closed population size

Wald Symmetric ± z(1-α/2) SE where z is a critical value of the standard normal distribution.

lognormal Asymmetric intervals based on log transformation following Burnham et al. (1987), Chao (1987) and Rexstad and Burnham (1991). Population size N must be at least as large as the number of individuals caught Mt+1, so for this parameter an interval is first constructed for log(N–Mt+1).

TIP: Profile likelihood or bootstrap confidence intervals are provided for some fields. Their selection (e.g. in Options | Open population) overrides this setting.

References


Density project file options

DENSITY project file

Load on open – The default action when a parameter set is opened with File | Open is to automatically execute 'Read data'. Override this by turning off 'Load on open'.

 Prompt to overwrite – An extra safeguard for .den files


ETA density calculator

This stand-alone calculator estimates density and its standard error from population size N-hat, an estimate of boundary strip width W-hat, the standard errors of N-hat and W -hat, and the perimeter length of a trapped area (e.g. Otis et al. 1978; Wilson & Anderson 1985 J Mammalogy 66: 13-21).

Default values for all inputs except SE(W-hat) are taken from the analysis for the current session, but they may be varied.


Detection function

Detection functions

The core idea of spatially explicit capture-recapture is to treat capture probability (p) not as a scalar quantity but rather as a decreasing function of the distance between a detector and the (loosely defined) centre of each animal's home range. Detection functions have a long history in distance analysis (Buckland et al. 2001), but the context of spatially explicit capture-recapture is quite different: the distances are not observed directly, and 'observations' result when the animal interacts with a passive detector rather a human observer. 'Detector' may refer to a trap, a camera, or some other sampling device with a definite location and limited scale of effect.

We use g(d) for a detection function where d is the distance between an animal's home-range centre and a detector.

Various forms are possible for g(d), but not all have been coded for IP SECR and ML SECR :

Detection function |  | IP SECR | ML SECR | Simulation1
Halfnormal | g(d) = g0.exp(–d2/(2σ2)) |  |  |
Negative exponential | g(d) = g0.exp(–d/σ) |  |  |
Hazard | g(d) = g0.[1–exp{–(d/σ)–z}] |  |  |
Uniform | g(d) = g0, d <= σ g(d) = 0, d > σ |  |  |
Compound half-normal | g(d) = 1 – [1 – g0.exp(–d2/(2σ2))]z |  |  |
Linear logit | g(d) = logit–1(logit(g0) – d/σ) |  |  |

1. For simulations, any of the detection functions may be modified by truncation beyond a user-specified radius (g(d) = 0 for d > r). See the 'Advanced' tab.

The parameters in each case include an intercept g0 and a spatial scale parameter σ, although the interpretation of σ varies. The intercept may be thought of as the probability of capture when the trap and range centre coincide. 'z' determines the shape of the hazard function and the compound halfnormal.

For the linear logit detection function, the intercept must be strictly less than 1.0. The logit function is described here.

Example of half-normal detection function with g0 = 0.4 and σ = 50 m.

Knowing the detection function is not usually sufficient to infer the probability of detection for an individual on a particular occasion. For that we also need to know how the detector works, and how detectors are arranged. This is because an animal may be caught in only one trap at a time ('camera trap' is a misnomer), and because some detectors are disabled once they have detected one animal ('fill up'). In these circumstances, g(d) gives the actual probability of detection only when there is a single animal and a single trap; in other cases there is a risk of trap competition or trap saturation. These effects are handled automatically by the simulation algorithm in IP SECR, which progressively removes traps and animals from the available pool as captures occur over a particular interval (e.g. one trapping night). ML SECR models competition between traps as a competing risks (Borchers and Efford 2008).

References


Detector type

Warning: Likelihood-based analyses (ML SECR) require data from just one detector type. The full input format described here is useful only with simulation and inverse prediction (IP SECR). However, from version 4.4 onwards you can use this format to identify detectors that were not used on one or more occasions (see Incomplete trap layout).

You may specify the detector type in the dropdown box of the 'Trap layout' window. Alternatively, for IP SECR you may select 'Abstract' in that dropdown box and specify the detector (trap) type and the number of occasions in the trapping session by adding a string of integer codes after the XY coordinates of each trap site. The integer codes must be from this list:

Code | Detector | Effect of detection event on behaviour:
 |  | Trap | Animal
0 | Not set | NA | NA
1 | Single-catch trap with live release | Disabled | Detained
2 | Multi-catch trap with live release | None | Detained
3 | Proximity detector | None | None
4 | Single-catch trap, no release | Disabled | Removed
5 | Multi-catch trap, no release | None | Removed

For example, three days of live trapping followed by two of kill trapping, with trap C1 not set on days 2 and 4:

A1 2674860 5982600 11144
B1 2674890 5982600 11144
C1 2674920 5982600 10104
D1 2674950 5982600 11144

etc.

Detector codes may be separated with white space (blanks, commas, tabs) (e.g. 1 1 1 4 4).


Statistical distributions

Distributions

These notes summarize some attributes of statistical distributions used in DENSITY and the methods used for pseudorandom numbers. A suitable statistical reference should be consulted e.g. Johnson and Kotz 1970. Williams et al. (2002 Appendix E) provide a useful account of some statistical distributions in an ecological context.

Uniform

Pseudorandom uniform random values U (0 < U < 1) are the basis for pseudorandom values from all other distributions mentioned here.

Normal

Pseudorandom normal values are obtained by the polar algorithm of Marsaglia & Bray (1964).

Logitnormal

The distribution of x is logitnormal if logit(x) has a normal distribution (0 < x < 1) (e.g. Frederic & Lad 2003).

The parameters of the logitnormal are the mean and standard deviation (μ, σ) on the transformed (logit) scale.

Closed-form expressions do not exist to relate μ and σ to the mean and SD on the untransformed scale (e.g. Frederic & Lad 2003). Density uses numerical integration. The conversion happens automatically when the user enters the desired mean and CV (SD/mean) for a logitnormal distribution (e.g. of individual capture probability in Simulation).

Pseudorandom logitnormal values are obtained by inverse-logit transformation of pseudorandom normal values.

Beta

The Beta is a distribution bounded by 0 and 1 that is often used to simulate probabilities. Its two parameters (α, β) are related to the mean μ and standard deviation σ by
 α = μ.(μ(1-μ)/σ2 – 1)
β = (1-μ).(μ(1-μ)/σ2 – 1) .

The algorithm used for pseudorandom Beta values in Density depends on α and β:

α<=1 or β<=1 | Johnk (1964) | Kennedy & Gentle 1980 p 216
α>1 and β>1 | Algorithm BN of Ahrens and Dieter 1974 | Kennedy & Gentle 1980 p 218

Lognormal

The distribution of x is lognormal if log(x) has a normal distribution (x > 0). Pseudorandom values are obtained by back-transformation of normal deviates.

Exponential

The exponential distribution has a single parameter λ that is also, conveniently, the expected value. Pseudorandom exponential values are obtained from a uniform random stream U by the transformation –log(U)/λ (e.g. Ripley 1987 p. 55. Algorithm 3.2).

Poisson

The term 'Poisson' is used both for a completely spatially random (CSR) 2-D point pattern and for the discrete univariate distribution. The two are linked: quadrat counts from an infinite CSR pattern have a discrete Poisson distribution with variance equal to the mean.

DENSITY generates pseudorandom Poisson counts by algorithm Q of Kennedy & Gentle (1980: 223; after Knuth).

Simulation of a sample from a 2-D Poisson distribution of animals is a 2-stage process. DENSITY first* determines the total population size N within the simulation arena by drawing a univariate Poisson pseudorandom value. Then for each of the N individuals draw two values of U for the X- and Y- coordinates.

* This step may be overriden in Simulation by choosing a fixed rather than Poisson population size.

See also : Transformations

References


Drawing colours

Select colours for the map on the main form.

A second colour may be used to distinguish captures before and after a particular time. To enable this option, ensure that the split time ('Occasion split' in Drawing options) is within the range of occasions in your data. The 'Captures' colour chip will then split in two.

An alternate trap colour (default black) will appear if you display detector usage. This colour definition has yet to be used elsewhere.


Drawing options

ETA – Perimeter points per trap
Number of points on the circumference of a circle formed around each trap when calculating a convex polygon boundary. Increasing this number increases the time taken to display the perimeter and marginally improves the precision of area estimates.

Contour grids – Mesh
'Pxy contours' evaluates naive capture probability Pxy at a grid of points. By default there are 128 meshes in both x- and y-directions, and hence 128 x 128 = 16384 points in total. As little as 48 x 48 seems to give an adequate contour map with a simple trap layout.

Capture locations – 'Use second colour from occasion m'.
This controls the display of captures on the main form ('Show captures'). Captures on occasions t >= m are displayed in an alternate colour (cf captures in occasions t < m). The second colour is selected in Options | General by clicking on the right side of the 'Captures' colour patch.


Effective sampling area

The likelihood-based methods of Borchers & Efford (2008) use a quantity 'a'

In words, 'a' is the integral over all possible home-range locations (X) of the probability that an individual at location X will be detected at least once, given the detection function parameters θ. Often, θ = (g0, σ). Because it is an integral over space, 'a' has units of area (e.g. hectares). The most useful thing about 'a' is that it relates the number of individuals detected in a study (n) to an unbiased estimate of population density (D):
(1)

We call 'a' the 'effective sampling area'. This follows from the long-established use of such terms as 'effective detection radius' and 'effective detection area' in distance sampling. We often use 'esa' in preference to 'a' as it is more distinctive and memorable.

Note that esa is NOT the effective trapping area (ETA or AW). These are radically different concepts. In conventional capture-recapture (e.g. Otis et al. 1978):
(2)
Equations (1) and (2) differ in where they allow for incomplete detection. The conventional capture-recapture formula (2) separates a 'non-spatial' component in the numerator (where there is an implied p-hat for incomplete detection) from a 'spatial' component in the denominator. In (1), incomplete detection appears only in the denominator. It is clear that 'a' does not relate to a definite (mapped) geographic area. Although AW is sometimes understood to refer to a geographic area, this is a misconception because there is generally no such area that contains all the trappable individuals and no others. In both cases the word 'effective' indicates a degree of abstraction (as in genetic 'effective population size').

The form of (1) is convenient for a secondary reason. When the detection parameters θ are modelled as varying between individuals, we can derive an individual estimate of esa for each animal detected. Such a model may be fitted by maximising the conditional likelihood (i.e. conditioning on n). A derived estimate of density is then the sum of the reciprocals of the individual esa:

Revised 2009 01 09


Export capture histories

Capture data may be exported for analysis in MARK, M-SURGE etc. The presently available formats strip locational information. The common currency is the 'capture history' of an individual. This codes encounters as '1' and non-encounters as '0' (e.g. '0 1 0 0 0' for an animal caught only on the second occasion of a 5-occasion trapping session).

Each animal is represented by a separate line in the output file (i.e. no attempt is made to consolidate identical histories), so the last value on each data line (the frequency) is always 1. Each history is preceded by a comment containing the identifier of the animal.

/* Encounter histories exported from Program DENSITY 18 December 2004 16:33 */
/* Data from capt.txt     */
/* Time intervals 1 1 1 1 */
/* 5 encounter occasions  */
/* 1 */ 01000 1;
/* 6 */ 10111 1;
/* 7 */ 11111 1;
etc.

Capture histories may be for

  • closed-population (current session) only (columns represent occasions)
  • closed-population, with trap ID instead of '1' and no-capture code (Options | Output) instead of '0'
  • open-population only (columns represent sessions, recaptures within session ignored), or
  • robust design (columns represent occasions; time intervals 0 within sessions and > 0 between sessions).

The user is prompted for the desired format.

Active filters apply.


Export site histories

Site histories are exported to a text file. A site history for a trap site records the number of animals detected at the site on each successive occasion.

Active filters apply.

See also: Data menu


Capture data box

Options | Output – Fields in output

Tick fields that you want in the output table.

Click on a field name for an expanded description.

Possible and default fields change with the type of analysis selected. For most analyses the default set is smaller than the possible set (i.e. some fields only appear in the output if selected manually).

See also: Optional outputs, List of output fields


Files menu

Open | Ctrl+O | Open a '.den' project file if one has been saved previously
Save | Ctrl+S | Save the current project file
SaveAs | Ctrl+A | Create a new project file
Exit | Ctrl+E | Terminate the program


Filters

Use filters to restrict the data to be analyzed or to group data from adjacent occasions or sessions. Effects vary with the type of filter:

  • Occasions
  • Sessions
  • Captures
Filters are applied as capture data are read into memory. Any change in a filter takes effect only from the next 'Read data'. Double-click to reset a filter to the default 'ALL' (equivalent to a blank filter).

Filters apply also to exported data (Data | Export capture histories).


Graphic interface

DENSITY provides tools for exploring spatial capture-recapture data that we think are unique in the field.
  • Petal display of spatial capture histories over a trap map more
  • Point-and-click selection of individual capture histories
  • Selected individual may be tracked over sessions
  • Background digital image more
  • Contours of the probability of detection Pxy vs home range location, given a detection function more
  • Probability distribution of location-dependent detection probability Pxy
  • Plot of the area within increasing contours of detection probability Pxy
  • Probability contours for location of an animal's home range centre, given a detection function
  • Bivariate confidence ellipses for parameters estimated by SECR more
  • Habitat mask overlay (automatically clipped to current buffer width) more
  • Visualisation of density surface for simulated point patterns, given a home range model (in 'Power analysis')
  • Summary plots of trap-revealed movements (distance and direction)
  • Trap-revealed asymptotic range length (fitted exponential curve) more
  • Instant plots of profile likelihood for common closed-population estimators
  • Perimeter of effective trapping area using conventional (convex) boundary strip, generalised to any trap layout more
  • 'Concave' perimeter option based on distance to nearest trap


Spatially balanced samples GRTS

Spatially balanced sampling with GRTS

It is desirable that the sample for SECR is spatially representative of the animal population. One way to achieve this is to lay out a systematic grid, choosing the grid spacing to give a desired number of points (trap sites), and ideally using a random grid origin. This method fails for SECR if the required grid spacing is larger than the size of typical home ranges. Another way is to lay out a much finer grid (or other arbitrary layout) and to treat this as a sampling frame from which the desired number of points are selected at random. The sample will include a greater range of 'nearest trap' distances than a systematic grid with the same number of points. However, a simple random sample will often by chance omit some areas of interest. Spatially balanced random sampling aims to achieve a better sample distribution; the 'generalized random tessellation stratified' (GRTS) method of Stevens & Olsen (2004) is one such method.

Trent McDonald has written the software 'S-draw' to make GRTS generally accessible (McDonald 2004). Trap Builder in DENSITY calls the command-line version of S-draw to select a 2-D GRTS sample from an input trap file. S-draw is freely downloadable from http://www.west-inc.com/computer.php and a copy is included with DENSITY.

DENSITY calls S-draw without weighting. You probably will not need to change pixelsize from the default (1 metre). When you 'Place traps' or 'Refresh' the results appear on the 'Trap coordinates' tab, and may be saved as usual.

GRTS sample : 20/121 detectors | GRTS sample : 50/121 detectors

WARNING: In my limited experience, GRTS samples from S-draw look quite like simple random samples, so the gain from using the more sophisticated method may be small.

TIP: You can use this as a general interface to 2-D GRTS. The input file defines a sampling frame of points in 2 dimensions; the output file generated when you 'Save' is a spatially balanced subsample of points.

References


Text input Habitat mask polygons

Text input of habitat mask polygons

A text file of polygon vertices should have the following structure (modelled on ARC Generate line format):

Polygonname1
x11 y11
x12 y12
...
end
Polygonname2
x21 y21
x22 y22
...
end
...
end 		Example :
seg1
365 365
365 435
435 435
435 365
end
seg2
465 465
465 685
685 685
685 465
end
end

Polygons are assumed to use the same cartesian coordinate system as trap locations. Polygons need not be closed (i.e. the link between the final point and the initial point is understood). Projections are not used.


Help menu

Contents Ctrl+H | Help Contents
Index | Help Index
About Density | Version, licensing and contact information
Density home page | Open www.otago.ac.nz/density in default browser
Bug reports | Open a text file BugReport.txt to record bugs and problems for later reporting. The file is saved automatically. <Ctrl> D inserts the current date.


Home range statistic

Home range statistics

These statistics summarize the movements of individual animals from trapping data ('trap-revealed home range'):

d-bar | Mean recapture distance pooled across all individuals:
RPSV | Square root of pooled spatial variance
P(d=0) | Proportion of recaptures in the same trap
ARL | Asymptotic range length m
MMDM | Mean maximum distance moved (observed range length) m
t2r2 | Schoener's ratio t2/r2, pooled over animals

Each of these measures is affected by the trap layout and trapping intensity. ARL and MMDM are sometimes used to calculate the effective trapping area. Schoener's ratio sheds light on the serial correlation in capture location.

For IP SECR, DENSITY requires a measure of home range size (aka 'movement') that can be computed from the capture locations of individual animals. It is tolerable for the measure to depend also on the trap layout and trapping intensity, as these variables are controlled within the simulation and inverse prediction algorithm. Select the home range statistic for inverse prediction in Options | IP SECR. The options are 'RPSV' (the default from DENSITY 3.3 on) and 'd-bar', with these definitions:

RPSV (root pooled spatial variance):

RPSV

where [image] is the arithmetic mean location of individual i.

d-bar (mean distance between the ni successive capture locations (xi,j, yi,j) of an individual i, pooled across all recaptured individuals):

dbar.

Informal trials suggest that RPSV is much more robust than d-bar to serial correlation of capture locations. It may suffer the downside of being more sensitive to outliers (see e.g. Trapping web example).

See also Effective trapping area

TIP: If you want to summarise trap-revealed movements and compare them over time or between places then you should consider using the scale parameter estimated by fitting an SECR model.


Individual covariates

An individual covariate is a numeric value used to model detection of an individual (g0 or σ or both). Individual covariates are used in ML SECR and in linear-logistic (Huggins) modelling for closed population size. Individual covariates are a powerful tool for reducing the pernicious effect of heterogeneity in detection probability (bias in estimates of population size or density).

Individual covariates are input by appending one or more values directly to each input line in the capture data file.
TIP: No '/' delimiter is required (cf trap covariates)
TIP: It is not strictly necessary to repeat the covariate value for an individual on all its input lines; it should be sufficient that it appear on at least one line.

When specifying either a within-session SECR model or a linear-logistic closed population model you may select covariates to include in the model using the relevant filter in Options (SECR models are limited to one covariate at a time in DENSITY 5.0, but not in the R package 'secr').

Individual covariates may sometimes have a special interpretation, as in the PG covariate.


IP Adjusted SE

IP SECR – Adjusted SE

The inverse prediction method estimates a global Poisson 2-D spatial point process for the unknown locations of animal home range centres. Our estimate of density is the global intensity of the spatial point process. In reality we have sampled only a small region in the vicinity of the traps. The expected density D in this local region is exactly the global intensity of the process. However, the sampling variance of local density [here SEIP(D-hat)] includes spatial variance in the global process. This uncertainty comes from not knowing whether we have by chance sampled a region of unusually low or high density within the overall pattern. For many purposes, the sampling error that matters is conditional on the local density and does not include spatial variance - this is the 'Adjusted SE'.

We estimate the conditional sampling variance by subtracting an estimate of the spatial variance. The number of range centres in a finite quadrat with area A is Poisson with mean and variance equal to D.A. Our 'quadrat' has fuzzy edges and is not square, but the principle still applies (see note below for Var(DETA)).

Adjusted sampling variance = SEIP(D-hat)2 – Var(DETA).

The square root of this residual variance is output as the field 'SE.IPAdj'. For internal reasons DENSITY copies the the estimate IPDens as IPAdj; only the SE changes. e.g.

Select the output field 'IPAdj' to include the adjusted SE in the output file.

TIP: Efford (2004) discussed an alternative method for removing the spatial component of sampling variance. This was to simulate home range centres from an 'even' distribution rather than a Poisson distribution. See Options | IP SECR.

___________________________________________________________________

Note: Derivation of spatial variance when effective trapping area ETA unknown.

We require Var(DETA) = E[(DETA – D)2]. With DETA = NETA/AETA, and N = E(NETA),

Var(DETA) = 1/ AETA2 . E[(NETA – N)2].

N is a Poisson variate with equal mean and variance, so this reduces to

Var(DETA) = DETA2 / NETA.

The closed-population estimate of NETA, and the inverse-prediction estimate of DETA
are substituted for the respective parameters.

___________________________________________________________________


Inverse prediction - Advanced settings

Options | IP SECR – Advanced settings

These settings are revealed by the 'Advanced' page in Options | IP SECR. They can safely be ignored most of the time.

Search

  • Convergence test from box... When first to think of giving up
  • Maximum iterations (boxes) Absolute limit (give up when reached)
  • Maximum retries If algorithm trips up, it will try again up to this limit.
  • Times to run each search The inverse prediction estimator is based on a stochastic simulation model and estimates therefore vary. To check on the size of this variation use this setting to perform repeat runs with the same input data.

Interface

Prompt on zero captures
 Tick to display warning messages when simulations yield no captures. This often happens when there are very few traps, when density is low, or when trappability is low (small g 0 and σ). Density estimation is often possible even when a fraction of simulations fail.

Transformations

Transformations are potentially useful to keep parameters within bounds or to improve the planarity of the relationship between the X and Y values. By default, the capture probability statistic P is converted to an odds ratio P / (1-P).

Relative size of design

This late addition enables you to shrink the design for particular parameters relative to others. With the default settings of 1.0, all parameters are varied about the initial values by the proportion indicated in Options | Inverse prediction 'Size of search box' (default ± 20%). If you change the relative size of g(0) to 0.5, then g(0) alone will be varied by ± 10%.


Inverse prediction - Design

Options | IP SECR - Experimental design

The Design settings determine how many simulations are performed and where they lie in the parameter space relative to the current best estimate.

Design
Choose between a full factorial (n = 2k), fractional factorial (n = 2k-1) or simplex (n = k+1) experimental design (number of points where k = 3 is the number of parameters). Fractional and simplex designs use fewer points (vertices) and are faster, but the fit may be poor and failure is more likely.

Centre points are recommended, and 3 is as good a number as any. Centre points are required for the assessment of planarity.

Size of search box ± %
Sets the dimensions of the design in parameter space as a percentage of the initial values on the main form. For example, if the initial value of the parameter vector (D, g 0, σ) is (5, 0.2, 25) and a box size of ±20%, then the first simulations in a full factorial experiment will be conducted at the vertices (4,0.16,20), (6,0.16,20), (4,0.24,20), (6, 0.24, 20), (4,0.16,25), (6,0.16,25), (4,0.24,25), and (6, 0.24, 25).

Minimum replicates per vertex
Maximum replicates per vertex
Required vertex precision
These settings jointly control the number of simulations conducted at each vertex during the search phase. There is little reason to vary the minimum. Replicates are added until the required precision is achieved in all statistics or the maximum is reached. A maximum that is too low yields estimates of unknown precision - check this by examining the log file where the actual number of simulations per vertex is recorded.

Phase II
By ticking this box the user can restart inverse prediction with different settings, using the estimates from Phase I as the starting point. It is uncertain whether this refinement is beneficial, and you may never use 'Phase II'.

See also : Dispersion, detection model, and other critical settings.
Advanced IP SECR settings


Inverse prediction inferred strip width

IP SECR – Inferred strip width W

The beauty of the SECR estimators of density is that they do not use a boundary strip and effective trapping area. However, it is possible to infer the effective trapping area from the density estimate (AW = N/D-hat). It is further possible to infer the boundary strip width W-hat implied by AW (The polygon method used – convex or concave – is taken from the ETA density tabsheet on the main form). DENSITY finds W-hat by an iterative search along the real line for the value that would have yielded the estimated density.

Select the output field IPInfrW to include W-hat in the output file.


Inverse prediction - initial values

IP SECR – Initial values

The inverse prediction algorithm for density estimation requires starting values for D, g(0) and σ. Although these may be entered by the user ('Manual') it is generally easier to rely on the automatic algorithm ('Auto').

See also IP SECR Estimating density


Inverse prediction - Other settings

Options | IP SECR – other settings

Detection model
Model for the detection function g(r) where r is the distance between a trap and an animal's home range centre.

Halfnormal | g(r) = g0. exp(-r2/2/σ2) | (default)
Negative exponential | g(r) = g0. exp(-r/σ) |
Uniform | g(r) = g0, g(r) = 0 | r <= σ r > σ

Distribution model
Poisson (the default) or 'even' dispersion of home range centres in simulations for inverse prediction. An even dispersion leads to lower prediction variance in estimated density because it excludes most random variation in local density due to the spatial point process. See also Adjusted SE.

Variance
Calculate variance
 This option causes the program to perform additional simulations to estimate the variance-covariance matrix and hence the prediction standard errors of the estimates (e.g. Pledger & Efford 1998). Otherwise the inverse prediction estimates are reported without errors. Omitting this calculation may be useful to speed up estimation.
Number of replicates
The number of simulations performed. The precision of the SE estimates is partly determined by the number of simulations.

See also Advanced inverse prediction settings


Inverse prediction - planarity

Inverse prediction – Planarity

Inverse prediction relies on there being an approximately linear relationship between the parameters of interest and the sample statistics, at least over the small region near the true value. As linearity must be simultaneous in three dimensions we use the word 'planarity' - we hope the relationship is a hyperplane. Substantial deviation from planarity causes bias in one or more of the estimates. We can assess this by comparing the mean of the outer points of the factorial or simplex design with the mean of the centre points. Ideally they will coincide (outer points are always distributed symmetrically about the centre). The log reports the relevant results. As a final check, DENSITY averages the simulated statistics (Nhat etc.) at the solution point while obtaining the variance-covariance matrix. This vector would ideally equal the target vector (see log).

Large deviations from planarity (>> 1%) are a concern, especially if they involve a parameter of interest. Sometimes the cause is inadequate precision and the problem may be fixed merely by increasing the number of replications and decreasing the required CV per vertex. Otherwise you can try transforming the x-variables (the parameters Density etc.) or the y-variables (the statistics Nhat etc) or selectively reducing the relative size of the design for the critical parameter(s) (see IP SECR Advanced).

More systematic investigation of these issues is called for. It is comforting that for field data the effect of these design choices on the estimates is usually very much less than the sampling error.


Inverse prediction - statistics

Options | IP SECR – Summary statistics

Inverse prediction relies on intermediate statistics (summaries of the data) to capture information on each of the parameters of interest. The N-estimator, P-estimator and movement statistic have a one-to-one relationship to the parameters of interest (Density, g(0) and σ, respectively). The user may choose among closed-population estimators, and between two measures of movement.

'Estimator' on the IP SECR page in Options echoes the closed population estimator on the main screen - changing one changes the other.

RPSV is the square root of the squared recapture radii, pooled across individuals. It appears to be more robust to serial correlation in the detection locations than the mean recapture distance (d-bar).

See also IP SECR estimating density


Inverse prediction - theory

Inverse prediction – Theory

Inverse prediction (Brown 1982; Pledger & Efford 1998) can be used to fit a spatial detection model to capture-recapture data (Efford 2004). Observations are simulated for known values of the parameter vector (D, g0, σ). An observation is a vector of the form (N -estimate, p-estimate, movement statistic).
The parameter vector x and simulated observations y may be used to fit the multivariate multiple regression:
where λ is a 3 x 1 vector of intercepts, B is a 3 x 3 matrix of coefficients, and E is a 3 x 1 vector of error terms with multivariate normal MVN(0, V) distribution. With sufficient replications, the elements of λ, B, and E are estimated virtually without sampling error.
Given a single observation y P, the point estimates of D, g(0), and σ (together, the vector x P) are given by :
 | .
The model equation rearranges to
 | .
where the random error B–1E has distribution MVN(0,Γ) and Γ = B–1V B–1T.

References


List of output fields

Output fields

Fields vary depending on the analysis selected. See the checklist on Options | Output page

Closed-population
 | Session | Session identifier
 | NCapture | Number of detections
 | NAnimal | Number of unique individuals
 | NRecap | Number of recaptures (detections of previously marked animals)
 | NotRlsd | Number not released (indicated by negative occasion code in capture data)
 | CPEstim | Name of closed-population estimator, mostly after Otis et al. (1978)
 | CPNpar | Number of parameters in closed-population model (MLE only)
 | CPLoglik | Maximised log likelihood (MLE only)
 | CPAIC | Akaike's Information Criterion for closed-population model (MLE only)
 | CPNhat | Closed population estimate N-hat using 'Estimator'
 | CPphat | Per occasion capture probability implied by N-hat
 | RPSV | Sqrt(spatial variance of capture locations) (m) pooled over individuals
 | dbar | Mean recapture distance
 | Pzero | Proportion of recaptures in same trap
 | t2r2 | Autocorrelation test statistic: Schoener's ratio t^2/r^2 pooled over animals
 | ClosStat | Closure test statistic Otis et al 1978
 | WCode | Boundary strip result code
 | WDens | Density estimated as N/A(W) using W-hat to obtain effective trapping area A(W)
 | MMDM | Mean maximum distance moved (observed range length) m
 | ARL | Asymptotic range length m
Density estimates – Inverse prediction
 | IPCode | IP result code ('OK' indicates successful completion)
 | IPDens | Density estimated by inverse prediction
 | IPAdj | IPDens with SE adjusted for spatial variance
 | IPg0 | g(0) estimated by inverse prediction
 | IPSigma | sigma estimated by inverse prediction
 | IPInfrW | Boundary strip width (m) inferred from IPDens
 | IPTime | Inverse prediction elapsed time (minutes)
Density estimates – Maximum likelihood
 | MLCode | ML result code ('OK' indicates successful completion)
 | MLDetFn | ML detection function class (halfnormal, hazard etc.)
 | MLModel | ML within-session model
 | MLBuff | ML width (m) of integration buffer beyond outermost traps
 | MLnpar | ML number of parameters estimated
 | MLLoglik | ML maximised log likelihood
 | MLAIC | ML Akaike's information criterion for fitted model
 | MLAICc | ML Akaike's information criterion with small sample correction
 | MLDev | ML Deviance
 | MLdf | ML degrees of freedom for MLDev
 | MLesa | ML estimated effective sampling area (D-hat = n / esa-hat)
 | MLDens | ML estimate of density
 | MLg0 | ML estimate of g0 ('intercept' parameter of detection function)
 | MLSigma | ML estimate of sigma (scale parameter of detection function)
 | MLhazb | ML estimate of shape for 'hazard' detection function
 | MLPsi | ML estimated proportion in latent class 1 (finite mixture models)
 | MLPsi2 | ML estimated proportion in latent class 2 (finite mixture models)
 | MLg02 | ML estimate of g0 for latent class 2 (finite mixture models)
 | MLg03 | ML estimate of g0 for latent class 3 (finite mixture models)
 | MLSigma2 | ML estimate of sigma for latent class 2 (finite mixture models)
 | MLSigma3 | ML estimate of sigma for latent class 3 (finite mixture models)
 | MLg0b | ML estimate of effect size for behavioural response to capture: g0 (link scale)
 | MLsb | ML estimate of effect size for behavioural response to capture: sigma (link scale)
 | MLg0t | ML estimate of coefficient of time effect: g0 (link scale)
 | MLg0z | ML estimate of coefficient of individual covariate effect: g0 (link scale)
 | MLg0k | ML estimate of coefficient of trap covariate effect: g0 (link scale)
 | MLst | ML estimate of coefficient of time effect: sigma (link scale)
 | MLsz | ML estimate of coefficient of individual covariate effect: sigma (link scale)
 | MLsk | ML estimate of coefficient of trap covariate effect: sigma (link scale)
 | MLTime | ML elapsed time (minutes)

Open-population (between sessions)
 | n | Number caught
 | R | Number released
 | m | Number marked in sample
 | r | Number recaptured later
 | z | Number known alive but not caught
 | NJS | Jolly-Seber population size
 | pJS | Jolly-Seber capture probability (also Cormack-Jolly-Seber recapture probability)
 | BJS | Jolly-Seber recruitment
 | Phi | Apparent survival rate φ
 | PhiAdj | Apparent survival rate adjusted to constant interval
 | CovPhi | Covariance (φi, φi+1)
 | Gamma | Pradel seniority γ
 | Lambda | Relative population growth rate λi = φi / γi+1
 | RobustB | Estimated recruitment via Pollock's (1982) "robust" design
 | RobustD | Estimated recruitment for "robust" design, using IP density
 | LambdaK | Ratio N(t+1)/N(t) for "robust" design
 | MNA | Minimum number alive

Radiotelemetry for density estimation
 | PG | Mean proportion of time on grid or within arbitrary area
 | PGDens | PG density estimate (cf Grant & Doherty 2007, Efford unpubl.)

References


SECR likelihood evaluator

This form evaluates the log likelihood of an arbitrary (user-supplied) set of parameter values under the current SECR model, given an input data set. It is useful for checking the stability of the computed log likelihood with different numerical integration settings (e.g. buffer width or number of points in mesh). By selecting the 'Calculate SE' option it is also possible 'retrospectively' to estimate the asymptotic standard errors and covariance matrix corresponding to a particular point estimate. The covariance matrix is then available to plot confidence ellipses for pairs of parameters. The 'repeated evaluations' option is relevant only when the origin of the integration mesh is jittered (this causes slight variation in the computed log likelihood).


Losses on capture

Option to control the treatment of animals that die during a closed-population trapping session.

Ignore | Include in analysis as if released alive
Discard | Drop entire capture history (all records of the animal in this session)
Add back in | Omit capture history from analysis, but add the number of lost animals (omitted capture histories) to the final estimate (as advised by Otis et al. 1978)

WARNING: This option affects only the estimation of closed population size N.


Main menu

Density 4.2 main menu

Files
View
Data
Tools
Help


Trap map

Map of trap layout and captures

A map of trap locations is displayed automatically on 'Read data'

Click the 'Captures' button to show where animals were caught. Time of capture is coded by radial position - each possible 'petal' of the capture 'flower' at a trap site represents an occasion. Right-click on the map for a popup menu of display options :

Select by animal | Toggle on and off. When 'select by animal' is on, click on map to select all the captures of one animal, or scroll with the animal selector
Selected animal only | Display only one animal
Selected track only | Display only one track
Label times | Label the captures of the selected animal with the sampling occasion
Hide animal selector | Make 'animal selector' buttons temporarily invisible (e.g. when copying map to clipboard)
Stickiness of selector | Control speed of scrolling animals (delay in milliseconds)
Cycle through animals | Automatically advance to next animal after a time delay - useful for reviewing a large data set. Click on map to stop.
Set timer delay | see above
List capture records | Toggle tabular display of capture records; these are either all captures of a selected animal ('Select by animal' ticked) or all captures of all animals at one site.
Show tracks | Connect successive captures of an individual. See Warning below.
Hide animals | To emphasise tracks
Show only first capture | Do not display recaptures
Vary animal colours | To distinguish individuals
One occasion at a time | Display captures on each occasion separately (cycle through using selector that appears)
Show key to times | Numbered 'petals' for occasions at each trap site
Show detector usage | If Options | Input Incomplete trap layout, indicate which detectors used on each occasion
Copy map to clipboard | Image may be pasted from the clipboard into another document
Enlarge map | Toggle map size. Enlarged map obscures the 'trap layout' and 'capture data' input boxes.
Label trap sites | Display trap labels adjacent to sites
Traps as dots | Toggle symbol for trap sites: dots versus crosses
Hide traps |
Enlarge points | Toggle size of trap symbol, and size of capture symbol if captures are displayed
Show 100-m grid lines | Overlay grid lines (100 m or 1000 m depending on area units see Options)
Show integration mesh | Toggle overlay of the points in the mesh used for numerical integration
Show background image | Toggle display of the background image defined in Options | Graphics
Graphics options | Direct access to Options | Graphics for drawing colours etc.
Show hint | Toggle on or off the irritating reminder to 'Right click for map options' (this menu)

WARNING: tracks obtained by joining successive captures of an individual may be misleading for data from Proximity detectors as the temporal order of detections is unknown or not recorded.


Max duplicates

This option merely limits the display of repetitive error messages on input. It has no effect on any analysis.


Minimum N recaptures

The ad hoc measures of trap-revealed home range size ARL and MMDM are sometimes reported for a subset of animals only (e.g. those caught at least 5 times). These settings allow the user to apply such criteria to both data analyses (see main screen and Options | Output | Fields in output) and simulation.


Missing value code

Options | Output – missing value code

Values that cannot be calculated for any reason are represented in the output file by a missing value code. By default this is NA for compatibility with R and S-Plus. Any other string of 1-5 characters may be used.


ML SECR inferred strip width

ML SECR – Inferred strip width W

The beauty of the SECR estimators of density is that they do not use a boundary strip and effective trapping area. However, it is possible to infer the effective trapping area from the density estimate (AW = N-hat/D-hat). It is further possible to infer the boundary strip width W-hat implied by AW. DENSITY finds W-hat by an iterative search along the real line for the value of W that would have yielded the ML SECR estimate of density, given the current value of N-hat.

This calculation depends on the current closed population estimator for N-hat and the 'polygon method' (convex or concave), taken respectively from the Estimator box and the ETA density tabsheet on the main form.

Select the output field MLInfrW to include W-hat in the output file (this is the default).

Warning: W depends both on the grid configuration and on the peculiarities of the N estimator. As N is undefined in most grid trapping (there is no naturally defined 'population'), any N estimator is likely to be peculiar! See discussion in Efford, Dawson & Robbins 2004.


ML SECR encounter rate variance

DENSITY 4.2 currently computes the sampling variance of population density on the assumption that animals follow a 2-dimensional Poisson distribution. This estimate is vulnerable to deviations from the assumed spatial model. An alternative procedure, well established in the literature on distance sampling, is to combine empirical (design-based) estimates of the spatial variance (from replicate spatial samples) with (model-based) estimates of the uncertainty in the fitted detection function. These methods have yet to be developed for SECR. They will require additional information: the number of replicates at which no animals were recorded, and possibly also the relative sampling effort for each replicate. As a first step, DENSITY uses the number of sessions with zero captures (input in Options | ML SECR | Advanced) to calculate the overall variance of 'encounter rate' the number of individuals observed per session (where the 'sessions' are here assumed to be independent spatial units). A brief report is output to the log file after multi-session ML SECR analyses.

References


Estimating density ML

ML SECR - Estimating density by maximum likelihood

Spatially explicit capture-recapture (Borchers and Efford 2008) deals with observations at an array of detectors (traps) that may be summarised as spatial encounter histories like this:

             Occasion
ID     1    2    3    4    5
 1    A9    .    .    .    .
 2   A12  A12    .    .    .
 3     .    .   C6   B5    .
 4     .    .   G3    .   F3
...

'ID' refers to individual animals, and entries in the body of the table correspond to known locations (trap sites).

Such data (derived from the usual DENSITY input files) allow us to fit a probability model with two main parts:

  • the distribution of the animals or, more specifically, the distribution of points (xi, yi) (loosely, the home range centre of animal i)
  • a function for the probability of capture in a trap as a function of the distance from (xi, yi) to the trap.
Home range centres are not known, and there are probably too many animals and too few data to estimate (xi, yi) for each one. We solve this dilemma with a likelihood that integrates over possible animal locations. The (xi, yi) are assumed to follow a 2-D distribution (e.g. Poisson) whose density we would like to know. We maximise the likelihood numerically to estimate density and the parameters of the detection function. The minimum detection parameters are usually g0 (intercept) and σ (spatial scale).

ML SECR models may be selected from a rich set of possibilities on the Options | ML SECR page.

TIP: Spatial encounter histories from proximity detectors may include multiple observations of an individual on one occasion.

References


ML SECR assumptions

Assumptions of ML SECR

  1. The population is closed (i.e. there are no births, deaths or dispersal events during a trapping session).

  2. Capture does not affect the pattern of movement of an animal within a trapping session.

  3. Tags are not lost, and the identity and location of each recaptured animal is recorded accurately.

  4. Traps are set at known locations for a fixed time.

  5. Trap placement is random with respect to the location of animal ranges, and ranges are oriented at random.

  6. Animals occupy home ranges that do not change during a trapping session

  7. Home-range centres follow a Poisson distribution within the area sampled, or within a mapped subset of the landscape (i.e. habitat areas in the mask)

  8. Detection happens independently for each animal


ML SECR between-session model

Ticking the box for a 'between-session model' causes all sessions to be analysed together by maximizing a multi-session likelihood (the default is to report a separate analysis for each session). Technically, a between-session model uses a product-multinomial likelihood that assumes independent sampling in each session. On the 'between-session' tabbed page in Options | ML SECR you will see a continuation of the within-session parameter table, with the same number of rows. The user may place a separate constraint on the between-session variation in each 'within-session' parameter.

To change a constraint, double-click (to cycle) or right-click (for a popup menu). Constraints are chosen to construct models for biological hypotheses (e.g. a trend in density over time) or to optimise model fit (sometimes this is seen as a tradeoff between bias and precision in the estimates).

Constraint | Effect | Number of extra parameters
Constant | All m sessions use same parameter value | 0
Session | Each session has unique level of parameter | m-1
Linear trend | Linear trend | 1
Session covars | Linear function of a continuous covariate with a potentially different value for each session | 1
Session factor | Sessions are grouped into f classes by associating each with a user-defined alphanumeric code. Each class has a unique level of the parameter. | f-1

A 'Session' constraint is equivalent to a 'Session factor' constraint for which each session is a distinct level (f = m). Both 'Session covars' and 'Session factor' require the user to enter data in the session covariates form (above).

From release 4.2.3 onwards it is possible to specify additive between-session models. A parameter such as g0 may be modelled on the link scale as a linear combination of effects from two or more session-specific covariates. For example, by dragging X1 and then X2 into the 'Covariate(s)' field for a 'session covars' constraint for g0, you specify model in which
logit(g0) = beta0 + beta1.X1 + beta2.X2,
where beta0, beta1, and beta2 are coefficients to be estimated (Density labels these g0[1], g0[2], and g0[3]). Categorical effects (session factors) may also be combined; Density estimates one coefficient for each extra level. For an interaction between covariates, manually construct a new 'Session covariate' with their product (for a 'session covars' constraint) or one new level for each combination of levels (for a 'session factor' constraint). If you want to learn more about additive and interactive effects in capture-recapture models, check Lebreton et al. (1992) or the online MARK book (Cooch and White 2008).

Constraints other than 'Constant' always add parameters to the basic within-session model. Parameters receive the name of the original parameter followed by a number in square brackets e.g. Density[2] for the density in Session 2 with a 'Session' constraint. See the log file output for details. Intercepts are reported on the natural scale of each parameter, so the equation for a trend in density (assuming a log link) is actually log(Density) = log(Density[1]) + Density[2] x (session - 1)

TIP: To select a covariate from the session covariate form, drag its column header into the desired row of the model specification table.
TIP: Discrete individual covariates may be included in full-likelihood models by subdividing 'sessions'. For example, a sex difference in home-range size could be modelled by splitting the data into a 'male' session and a 'female' session and placing a 'session factor' constraint on σ.

WARNING: The implementation of between-session models in DENSITY is not fully tested, especially with respect to combinations with complex within-session models, and you are advised to use the R package secr for complex models.

See also Covariates, ML SECR parameter table, ML SECR model selection

 References


ML SECR bootstrap confidence intervals

Confidence intervals for detection parameters, including the effective sampling area (esa), may be obtained by nonparametric bootstrapping. See Dixon (2002) for a concise guide to bootstrapping.

Confidence intervals from the 'ordinary' bootstrap tend to have coverage that differs from the nominal rate (e.g. 95%). The 'studentised' bootstrap is an alternative with better properties. Other adjustments and bias corrections are not implemented.

The studentised bootstrap uses a preliminary estimate of the sampling variance (i.e. SE). DENSITY 5.0 does not compute the sampling variance of 'esa', so a studentised confidence interval is not computed for this derived parameter.

References

Warning: Although bootstrap results are provided for density (MLDens), these omit the substantial contribution of 'encounter-rate variance' to error in MLDens because the bootstrap samples are all of the same size n. Some SECR field designs allow an empirical estimate of the encounter-rate variance that may be combined with var(esa) as in distance sampling (Buckland et al. 2001).


ML SECR confidence intervals

Confidence intervals for all model parameters are based on an asymptotic estimate of the sampling variance (from the information matrix see e.g. Borchers et al. 2002 Appendix C). The limits are first obtained on the link scale (e.g. ± 1.96 SE for a 95% interval*) and then back-transformed, usually resulting in an asymmetrical interval.

Profile likelihood and bootstrap intervals are also available, but these take much longer to compute and do not seem to differ much from asymptotic intervals.

Density is not a model parameter for models fitted by maximizing the conditional likelihood. Density is then a derived parameter, and its variance is obtained indirectly (cf Huggins 1989, Borchers & Efford 2007). Intervals for density as a derived parameter are calculated on the natural scale (e.g. animals per hectare), and for this reason they are symmetrical about the density estimate (unless truncated at zero).

*The confidence level (α value) is set in Options | Output, as for other intervals in DENSITY

References


ML SECR distribution

Poisson vs Binomial

The number of distinct individuals caught (n) may be modelled as either Poisson or Binomial. The distinction rests on how we view the target population N. N is the number of individuals whose home range centres lie within the area of integration (i.e. the extent of the integration mesh, excluding any masked 'nonhabitat'). N may be considered as a Poisson-distributed sample from a superpopulation, in which case n is also Poisson-distributed. Or N may be treated as fixed; in which case n has a Binomial distribution. In the Poisson case, the area of integration does not appear in the model. See Efford and Fewster (2012) for more, including the alternative terminology 'expected N' (Poisson) vs 'realised N' (binomial).

The choice of distribution model has minor practical consequences. 'Binomial' conditions on the placement of the detectors, and this will be reflected in a lower sampling variance for the estimate of density. The variance will also depend to a small extent on the integration buffer width. A Poisson model is free of these constraints, but the resulting variance entails an assumption about the distribution of the superpopulation. In reality the spatial distribution of home range centres may be under- or (more likely) over-dispersed relative to a Poisson distribution.

A binomial model is appropriate when the area of integration (the masked area) corresponds to a natural unit of habitat (e.g. an island).

References


ML SECR goodness-of-fit

A deviance-based goodness-of-fit test is available.

Deviance = –2 (LL + LLsaturated) / (n–2),
where LL is the maximized log likelihood, LLsaturated is the log likelihood of the saturated model, and n is the number of distinct capture histories.

The sampling distribution of the deviance is determined by Monte Carlo simulation with the fitted model.

References


ML SECR initial values

Likelihood maximisation requires a starting value for each parameter in the model. These may be set manually, or using an automatic algorithm. The automatic algorithm is identical to that for IP SECR with respect to the core parameters D (full likelihood only), g0 and σ. Other parameters are set to arbitrary non-zero values.

TIP: The maximization algorithm fails when secondary parameters (e.g. the effect of trap response on g0, measured on a logit scale) are set initially to zero, although this is otherwise a valid value.


ML SECR 2-D integration

Integration is a necessary part of ML SECR. The likelihood for ML SECR is integrated over a 2-dimensional region containing the possible (and unknown) locations of the range centres of animals at risk of capture. An adequate definition of the region is important for both numerical and biological reasons. The numerical integration must be performed for each capture history in a dataset for each evaluation of the likelihood; this can take a long time.

The region of integration is based on a rectangle extending a certain distance (the buffer width) beyond the outermost traps in each of the cardinal directions. 'Buffer width' is taken from the trap layout box on the main form. Analyses should be insensitive to the buffer width beyond a minimum of about 4σ for a halfnormal detection function; 4 x RPSV is a fairly safe setting.

Integration algorithm

After some disappointing results with mainstream algorithms for 2-D integration (Genz & Malik 1980, Robinson & Hill 2002), we now use a simple discrete approximation i.e. summation of function values over a mesh of points. The finer the mesh, the better the approximation to a continuous model. The default mesh in DENSITY 5 uses 64 x 64 = 4096 points*. For some purposes, an even coarser mesh (32 x 32) may be accurate enough, and faster (in this case, up to 4 times faster). A mesh may be imported from a text file (x and y coordinates of one point per row); in this case the spacing of the mesh is inferred from the minimum distance between consecutive points. Habitat masks are implemented by automatically dropping mesh points that fall in areas of 'non-habitat'. Use Tools | Export on the main form to save the current mesh, inclusive of any habitat masking. A customized and imported mesh may be used instead of a habitat mask for ML SECR, but the two are not equivalent for simulation (Simulation or IP SECR). A different mesh may be imported mesh for each session. The current mesh may be visualised from the map popup menu.

* When the trap layout is elongated in one direction, DENSITY bases the mesh spacing on the narrower dimension of the bounding rectangle + buffer width, and rolls this spacing out in the other dimension, so the total number of mesh points may be greater than the nominal number.

Checking adequacy of buffer width and mesh spacing

The suitability of the chosen buffer width and mesh may be checked empirically with Tools | ML SECR log likelihood using these steps from the main screen:
  • 'Read data'
  • 'Tools | ML SECR log likelihood' to open 'Evaluate SECR loglikelihood' form
  • 'Specify model' (review model settings in Options | ML SECR)
  • Enter approximate values on the parameter bar e.g. 5, 0.2, 25 (or suitable values may be present from a previous model fit)
  • Select 'Vary number of mesh points'
  • 'GO'
  • Select 'Vary integration buffer'
  • 'GO'
The results will look something like this:

Log Likelihood evaluated at (5 0.2 25)
-787.58289  16 x 16 points
-787.51354  64 x 64 points
-787.51357  256 x 256 points
 (0.282 minutes)
Log Likelihood evaluated at (5 0.2 25)
-788.01471  50 m  buffer width
-787.51354  100 m  buffer width
-787.51307  200 m  buffer width
 (0.052 minutes)

Neither doubling the buffer width nor quadrupling the number of mesh points had any effect on the likelihood to 3 decimal places, and we conclude the initial settings were adequate (64 x 64 mesh, 100-m buffer).

References


ML SECR likelihood

ML SECR likelihood: Full vs Conditional

Spatially explicit capture-recapture may use either the full likelihood or the likelihood conditional on the number of animals captured, n (see extract below from Borchers and Efford 2008). Parameter estimates are expected to be similar or identical, but practical considerations may constrain the choice:

 | Full | Conditional
Estimate of density D | Direct | Derived
Variance of density estimate | Asymptotic | Derived
Profile likelihood interval for D | Yes | No
Between-session models for density | Yes | No
Asymptotic covariance between estimates of D and detection parameters (confidence ellipses) | Yes | No
Individual covariates of detection parameters | No | Yes
Relative speed | Slow | Fast

From Borchers and Efford 2008 3.1:
Notes
1. φ is just density D for a homogeneous Poisson spatial distribution (the case implemented in DENSITY).
2. The vector θ is simply (g0, σ) for the null within-session model when the detection function is halfnormal.

References


ML SECR link functions

Each parameter in a ML SECR model has a corresponding 'link function' that determines the scale on which it is manipulated within the maximisation algorithm. See Lebreton et al. (1992) and Cooch and White (2006) for further explanation of link functions in capture-recapture models. Parameter estimates in DENSITY are generally back-transformed to the natural scale for reporting (an exception is the asymptotic variance-covariance matrix in the log file: this remains on the link scale for each parameter). Confidence limits based on the asymptotic variance (± zα/2SE) are always calculated on the link scale and back-transformed.

Models are constructed on the link scale. When effects are combined


ML SECR losses on capture

Trapped animals sometimes die, or are not released for some other reason. 'Loss on capture' is indicated by a negative occasion number in the capture file. Settings in Options | Closed population for the handling of losses do not apply in ML SECR.

When the detector type is 'multi live', ML SECR correctly models the truncated capture histories of animals lost on capture (see Borchers & Efford 2008: 6.4 Other Extensions).

WARNING: 'Loss on capture' is not expected when the detector type is 'proximity', and in this case losses are ignored.

References


ML SECR likelihood maximisation

Maximum likelihood estimates (MLE) are obtained by numerically maximising the likelihood of the data with respect to the parameters of the capture-recapture model (i.e. by varying the parameters systematically until the maximum of tjhe likelihood function is found). Strictly, we minimise the negative log likelihood, which leads to the same parameter estimates. The procedure is entirely routine and seldom requires any user attention. Two standard algorithms are offered, both from J. Debord's DMath library. One algorithm (Broyden-Fletcher-Goldfarb-Shanno or BFGS e.g. Press et al. 1989) uses a numerical estimate of the gradient during maximisation and automatically returns the Hessian matrix that is used to obtain asymptotic variances and covariances. The other algorithm (Nelder and Mead's downhill simplex) finds the maximum first and must compute the Hessian as an additional step; variance calculation may be switched off to save a little time.

The minimum is considered to have been found when the reduction in the log likelihood is less than the absolute tolerance (default 0.0001). The numerical gradient is approximated by estimating the likelihood function at θ(1 ± ε) for each parameter θ and calculating the slope.

References


ML SECR model selection

ML SECR model selection generalities

Selecting a model has two goals:
  1. To identify structure in the data relevant to biological hypotheses (e.g. a trend in density), and
  2. To achieve the best possible estimates of biological parameters, avoiding bias and imprecision where possible.
The second goal may require that parameters are included purely to improve the fit of the model. A good example is a change in detection probability after first capture ('behavioural response'): neglecting such an effect can seriously bias estimates of density. It is better to use fewer parameters where this does not seriously impair the fit of the model: a good balance between fit and number of parameters is achieved by selecting the model with minimum AIC (or AICc) (Burnham and Anderson 2002).

To the best of our knowledge, general advice on model selection for conventional likelihood-based capture-recapture applies also to ML SECR. Do not attempt to fit all possible models (there are too many), but rather focus on those that are biologically interesting and defensible.

TIP: Models should NOT be compared by AIC when one uses the conditional likelihood and the other the full likelihood, or when they differ in the selection or pooling of data (Filters) or use different habitat masks.

TIP: Model diagnostics are presented most clearly and completely in the log file.


ML SECR parameter table

DENSITY maintains a table of the parameters in the current model. On the 'within-session' tabbed page in Options | ML SECR you will see something like this:

The within-session parameters shown here are of several types
  1. Density, the sole parameter for animal distribution. Appears in model only when the full likelihood is maximised.
  2. Primary parameters of the detection function: g0, σ ('Sigma') and z ('Hazardz').
  3. Parameters that modify the primary detection function parameters g0 and σ as required for the selected model. These are coefficients of separate linear predictors for g0 and σ on their respective link scales.
Primary detection parameters may also include the mixing proportion ψ ('Psi') when a finite-mixture model is selected. The '#' field is a unique parameter number used internally by DENSITY.

Link functions seldom need to be varied from the default shown here.
'PLI' is used to request a profile-likelihood confidence interval. Double-click to toggle between 'No' and 'Yes'.
Initial values may be edited only when 'Manual' is selected.

See also ML SECR within-session model, ML SECR between-session model, ML SECR initial values


ML SECR profile likelihood

ML SECR profile likelihood intervals

Profile likelihood confidence intervals (PLI) are preferred by many authorities to intervals based on asymptotic variance. Their relative merit for SECR estimates of density and related parameters has yet to be determined. In DENSITY, a PLI may be estimated for any parameter in the within-session model. This excludes population density when the model is fitted by maximising the conditional likelihood: D is not in the model. PLI are not available in DENSITY 5 for parameters of between-session models (e.g. trend). The confidence level (α value) is set in Options | Output, as for other intervals in DENSITY.

PLI are appended to the log file.

TIP: Calculation of PLI takes a long time, and it is usually done only for key parameters in the final model.

References


ML SECR single occasion

ML SECR with a single sampling occasion

Proximity detectors allow an animal to be detected at multiple places on a single occasion. A spatial detection model may be fitted to these data exactly as for multiple occasions (Efford et al. in press), although there are no 'recaptures' as such. The key assumption is that detections occur independently.

DENSITY is usually configured for data from multiple occasions. To analyse data from a single occasion, set 'Minimum number of recaptures' to zero (0) in Options | ML SECR | Advanced. This overrides a data check that would otherwise block analysis.

TIP: Within-session models with 'time effect' (t) or 'response to capture' (b) do not apply to single-occasion data. Other within-session models (heterogeneity, trap effect) are expected to be OK, but have yet to be tested. Between-session models should also be OK, but likewise have yet to be tested.

TIP: The fit of a single-occasion SECR model may be poor, and DENSITY may produce a result that is quite meaningless. Criteria for recognising pathological solutions are the subject of further research. In the meantime, discount any estimates for which the corresponding variance (or SE) is zero.

References


ML SECR within-session model

We model variation in each of the primary detection parameters: magnitude (g0) and spatial scale (σ). Covariate effects are additive on the link scale of the primary parameter. Time covariates and trap covariates are modelled as linear on the link scale. For example, a time covariate such as daily temperature might be used to predict the capture rate of a poikilotherm (e.g. skinks), effectively fitting the model g0(t) = logit-1(β0 + β1 x temp(t)) (assuming a logit link function). Values of within-session covariates (time, individual, or trap) are adjusted by subtracting the mean before the ML SECR model is fitted; the intercept is therefore the value of g0 or σ for the mean observed value of the covariate. See Borchers & Efford (2007) for more on modelling g0 and σ.

DENSITY adapts the classic notation of Otis et al. (1978; see below) and extends it for the much wider range of possibilities in SECR:

Symbol | Effect | Usage | npar
. (dot) | None | Constant | 1
t | time | Time covariate from 'Options | ML SECR' | 1
b | behaviour | Permanent learned response | 1
b1 | behaviour | Markov (one-time) response | 1
h | heterogeneity | Individual covariate from capture file (conditional likelihood only) | 1
h2 | heterogeneity | 2-class finite mixture | 2
h3 | heterogeneity | 3-class finite mixture | 4
k | trap | Trap covariate from trap file | 1

Effects are combined to give models such as g0(.)σ(.), g0(b)σ(.), g0(h2)σ(k). The letter 's' is used for σ when the Greek character is not available. There is no direct analogue in DENSITY 4 of the classic model Mt. Some combinations are excluded (e.g. with g0(h2) the only possible heterogeneity models for σ are h or h2 (not h3), and vice versa). There are 1152 permitted combinations.

The closed-population models of Otis et al. (1978) included three sources of variation in capture probability (p):

Symbol | Effect | Original usage
0 | None | Constant capture probability
t | time | Distinct capture probability for each sampling occasion
b | behaviour | Permanent learned response to capture
h | heterogeneity | Permanent individual differences. Not MLE.

Effects were combined to give the 'classic' models M0, Mt, Mb, Mh, Mtb, Mth, Mbh, Mtbh.

See also Covariates

References


No tag code

Options | Input – No tag

It is common in large capture-mark-release studies for some animals to not receive a unique individual mark. Typically, these animals died in traps or were deliberately removed. To ensure they are counted separately, DENSITY generates a unique identifier for each such animal at the 'Read data' step.

To flag a capture of a never-tagged (and removed) animal, place the code 'notag' in the AnimalID field. e.g.
B1 notag -7 B1CON1
(Untagged animal removed at site B1CON1 in Session B1, Day 7)

You may change the code in Options | Input | Capture data (it must not include any spaces). Each 'notag' individual will be assigned a unique temporary ID of the form NTxxx, where the 'NT' prefix may also be varied by the user and xxx is an integer.

TIP: Captures not followed by release should also be flagged with a negative occasion (day) number, but this is not critical on the last occasion of a trapping session (except in an open-population analysis).


'No-capture' code

This string is used when formatting capture histories for on-screen display. The default is '.' which is minimally distracting.

TIP: Data | Export capture histories uses '0' as required by MARK and other software, in preference to the no-capture code

See also Summary statistics


Upper bound for N

Relative upper bound for N

Some closed population estimators occasionally give wildly large estimates that are improbable a priori. This setting blocks such estimates and reports them as 'unable to be calculated' (NA). The default is 100 times the number of distinct individuals caught (M(t+1)). It is unlikely you will need to change this.


Occasion

What is an 'occasion'?

In conventional capture-recapture, 'occasion' refers to a discrete sampling event (e.g., Otis et al. (1978) and program CAPTURE). A typical 'occasion' is a daily trap visit. Although trapped samples accumulate over an interval (e.g., the preceding day), for analysis they are treated as instantaneous. Occasions are numbered 1, 2, 3, etc. The minimum data set for a closed population analysis is a set of two or more occasions (e.g., daily trapping for a week). (By contrast: 'occasions' do not appear in continuous-time capture-recapture models, where the focus is on the actual, observed times of capture events).

SECR in DENSITY follows conventional capture-recapture in assuming discrete sampling events (occasions). However, SECR takes a closer interest in the sampling process, and each discrete sample is modelled as the outcome of processes operating through the interval between trap visits. In particular, a model of competing risks in continuous time is used for the probability of capture in multi-catch traps (Borchers & Efford 2008).

The time interval represented by an 'occasion' varies widely between studies. Closed population analysis, including SECR, is valid when the duration of each occasion (and any intervening period when traps are closed) is matched to the species biology so that statistical assumptions are satisfied (e.g., independence and equality of capture probability between occasions, and no population turnover between the first and last occasions).

Proximity detectors allow multiple occurrences of an animal to be recorded in each sampling interval. For consistency we retain the term 'occasion', although such a sample is clearly not 'instantaneous'.

See also: ML SECR Proximity detectors on a single occasion

References


Occasion filter

An occasion filter is a text string that specifies a subset of sample times. Occasion numbers placed in square brackets will be grouped (i.e. appear in the analysis as a single occasion). List the sequence numbers of occasions to be used (separate by blanks or commas). Runs may be indicated by a hyphen '-' or a colon ':'. To combine occasions, place the occasion numbers in square brackets. Occasions are re-numbered from 1.

e.g. the filter '1 2 [3-5] 7' for data collected over 8 days will treat days 3 to 5 as one occasion and drop data from days 6 and 8. Occasions are renumbered:
Old New
1 1
2 2
3 3
4 3
5 3
6 dropped
7 4
8 dropped

Other examples:

Occasion filter | Interpretation
ALL | Use all occasions
1 3 4 5 | Use occasions 1, 3, 4, 5. Omit occasion 2 and any occasions after 5
1, 3:5 | ditto
1:5 [6-10] | Use occasions 1,2,3,4,5 and a grouped occasion 6 comprising the original occasions 6 to 10.

TIP: After 'Read data', check the Summary tab to verify the filter has the effect you intended.


Number of occasions per session

Options | Input - Number of occasions per session

DENSITY usually determines the number of sampling occasions in each trapping session by finding the maximum occasion number in the capture data. Sometimes this fails because there are no captures on the final occasion. Then the actual number of occasions should be specified in Options | Input. DENSITY cannot detect this condition: it's up to the user.

It is possible to specify the number of occasions separately for each session. To do this, click the 'Vary by session' button to open a table of sessions x occasions. Right-click to reset all sessions to a constant number of occasions.

This means there are three ways to set the number of occasions: implicitly (from the capture file), Options | Input | Occasions per session, and Options | Input | Vary by session. 'Vary by session' overrides 'Occasions per session' which overrides the implicit method. The 'Vary by session' button displays an asterisk when it has been activated. Any change applies only after you have re-read the data.

TIP: It's easy to get confused; check the Summary statistics for each session or the table of initial closed population estimates in the Log file.


Open population

Open populations

Simple non-spatial open-population analyses of multi-session data are possible in Density . See Pollock et al (1990), Lebreton et al. (1992) and Williams et al. (2002) for an overview of open-population models. Consider using MARK, POPAN or M-SURGE.

For open-population analyses,

  • Tick Options | Miscellaneous 'Enable multi-session analysis'

  • Select a model under Options | Open population

  • Tick the 'Open population' analysis box on the main form

  • Verify that the fields you require appear ticked in the Options | Output field list

Four models are provided*. Parameters are for the full time-specific model except that, with 'CJS' and 'Reversed CJS' only, the parameters may also be constrained to be constant over time.

  • Direct Jolly-Seber Estimates of population size Nt, capture probability pt, apparent survival ft and recruitment Bt as direct, closed-form Jolly-Seber estimates (Pollock et al. 1990). Additionally, seniority γt is estimated by reversing capture histories (CH), and population rate of change λt = f t / γt+1 (Pradel 1996).

  • CJS Estimates of capture probability pt and apparent survival ft by numerically maximizing the Cormack-Jolly-Seber likelihood.

  • Reversed CJS Estimates of seniority γt by fitting the CJS model to reversed capture histories (Pradel 1996)

  • Pradel's gamma Estimates of capture probability pt, apparent survival ft and seniority γt by numerically maximizing the likelihood given by Pradel (1996) for the γ parameterisation. Population rate of change λt = f t / γt+1. The likelihood includes an adjustment for loss on capture.

CJS and Reversed CJS may be applied in tandem to generate ft and γt..

Conventional (Direct) estimates of p, f and γ may exceed 1.0. This drawback is overcome in the other approaches by using the logit transformation. Maximization of parameters on the logit scale yields SE for p#, f and γ on the logit scale (find these SE in the log file). The delta method approximation is used for estimates of SE on the untransformed scale (e.g. Lebreton et al. 1992 p. 77)

DENSITY uses the studentized bootstrap to obtain confidence intervals for estimates of p, f, γ and λ. Capture histories are resampled with replacement, the number of histories in each sample equaling that in the original data. See Options | Open population to control the bootstrap sample size etc.

Not all parameters in full time-specific models are identifiable, and some are confounded with others (e.g. Nichols & Hines 2002). Confounded parameters are identified in the DENSITY log.

Summary of open population analyses in Density

 | Population size | Recruitment | Capture probability | Apparent survival | Seniority | Population growth rate
 | N | B | p | f | γ | λ
Direct JS | Jolly-Seber |  |  |  | Reversed CH | f t / γt+1
CJS | NA |  | CJS likelihood |  | NA | NA
Reversed CJS | NA |  | NA |  | CJS likelihood | f$t / γt+1
Pradel's gamma | NA |  | Pradel's γ likelihood |  |  | f t / γt+1

NA = not calculated
$ f from tandem application of ordinary CJS model.

Footnote: Several alternative parameterizations are in use for Jolly-Seber and Cormack-Jolly-Seber models. For example, relationships among γ, f, λ and f (per capita recruitment) are tabulated by Franklin (2001). We follow Nichols & Hines (2002) in stressing Pradel's γ parameterization, even when λ is the parameter of most interest (λ is estimated automatically by DENSITY). Numerical difficulties were experienced in maximizing the likelihood with the λ parameterization (Pradel 1996) because λ could not easily be constrained to feasible values (λt ³ ft).

* Use MARK, POPAN or M-Surge for more complex analyses (model averaging, individual covariates, multi-stratum models, age-dependent models etc.)
# We omit the 'hat' notation for estimates

References

See also: Open population extensions


Open population extensions

DENSITY includes a collection of optional add-ons to mainstream open-population analyses. These fields may be selected from the list of output fields when you have multi-session data and have enabled multi-session analyses.

RobustB
Pollock (1982) suggested combining within-session (closed) estimates of population size with estimates of survival between sessions to obtain a measure of recruitment:
B = Nt+1 – f tNt
(assuming no losses on capture). DENSITY optionally reports robust recruitment and its approximate SE (Pollock et al. 1990). First ensure that the analysis includes estimation of closed-population Nt (output field Nhat) and f t (output field Phi); then tick output field RobustB.

RobustD
This is a simple but untested extension of Pollock's (1982) suggestion, using inverse-prediction estimates of density D rather than population size N
BD = Dt+1 – f tDt.
BD has the same units as D (animals / ha or animals / km2)

LambdaK
The ratio of the closed population estimates in successive sessions K = Nt+1 / Nt.
This is a measure of relative population change directly analogous to λt. See also Skalski et al (1983, 1984). The approximate SE of LambdaK is calculated as

,

where SE(Nt) is the estimated standard error of the population estimate.

MNA
MNA ('Minimum number alive') is the sum of the number of animals actually caught in a trapping session (n) and the number (z) known to be alive (because they were caught both before and after) but not caught in the particular session. There is no statistically respectable case for the use of MNA, either as an estimate or as an index of population size. The count n (alias Mt+1) is a better index because samples in the middle of a sequence are not biased relative to those near the ends.

References


Optional statistics

Options | Output – optional statistics

'Optional statistics' are generated for some output fields and not others.

DENSITY can be sensitive: Fail to tick critical boxes and you will sometimes lose output. Tick too many boxes, and your results will be hard to find in the sea of empty output (values that could not be calculated).

Standard error | Required for most analyses and ticked by default
Confidence interval | Profile likelihood or studentized bootstrap intervals, where available
Bootstrap mean | Mean of estimates obtained by bootstrapping capture histories (open population only)
Line space | Insert a blank line to separate sessions


Options R interface

Options | R interface

R executable

DENSITY is usually able to find the path to the R executable if you have R installed, and the name will appear here. Click Find to refresh. This is necessary if you reload a DENSITY project after installing a new version of R. However, it is not obligatory to use the Windows Registry when installing R, and in this case you should provide the full path here. If necessary, look for R.exe in places like c:\Program files\R\R-2.15.2\bin, c:\Program files (x86)\R\R-2.15.2\bin, or c:\R\R-2.15.2\bin.

Command and output files

Text files are automatically created by DENSITY for R command input and console output. You may name them here. Be aware that they are overwritten automatically: results that matter should be saved elsewhere (note the Write to log and Copy to clipboard popup menu options when you right-click in the Output window).

Whatever destination you choose, the command and output files are written to the working directory (Options | General).

DENSITY also constructs temporary files (temp0001.txt, temp0002.txt etc.) in the working directory when it needs to transfer covariate information to the R workspace, or when captures are filtered.

R CMD BATCH options

Options for the commandline call of R. If you change the defaults for saving and restoring sessions it will be difficult to build on previous analyses. The unticked 'Show timing' option by default suppresses the display of proc.time() at the end of the batch job.

R commands

Minor settings that affect the appearance of the R output, plus the option of using multiple CPUs (see R interface).

'Append output in window' causes results to accumulate in the Output window - useful if you are adding to analyses rather than repeating the whole lot.

See also R interface


Output style

Options | Output – Output style

The output table comprises a number of fields (columns) for one or more sessions (rows).

Fields (e.g. Nhat) optionally generate related statistics (e.g. SE.Nhat). Output style determines whether these statistics are inserted as additional columns (Flat) or as additional rows (Stacked).

Flat
Session NAnimal Estimator   Nhat  SE.Nhat
      1      76      Null  76.00     0.81

Stacked
Session Stat NAnimal Estimator  Nhat
      1  Est      76      Null 76.00
      1   SE      NA        NA  0.81


Example output

Example of IP SECR output

============================================
DENSITY : Version 3.2 28 November 2004 20:39
============================================

Traps             : C:\Density\bin3\trap.txt
Trap type         : Single live
Captures          : C:\Density\bin3\capt.txt
Input format      : X-Y coords
Log               : C:\Density\bin3\density3.log
Habitat mask      : None
Session filter    : ALL
Occasion filter   : ALL
Capture filter    : ALL
Varying effort    : No
Population buffer : 100 metres
Density units     : ha
Distance units    : m

INVERSE PREDICTION
Detection model          : Halfnormal
Parameterisation         : Probability
Population dispersion    : Poisson
Random generator         : Intrinsic Seed 987654321
Home range statistic     : Sqrt(pooled spatial variance) RPSV
Parameter transformation : Odds(p-hat)
Design - Phase 1         : Full design (3 centre points) Size ± 20%, Min repl = 10, Max repl = 2000, CV = 1.00%,
Simulations for variance : N = 1000

OUTPUT
Session | Stat | Estimator | Npar | AIC | Nhat | phat | RPSV | IPCode | IPDens | IPAdj | IPg0 | IPSigma | IPTime
1 | Est | Null | 2 | -3.17 | 76.00 | 0.6184 | 36.4 | OK | 5.620 | 5.620 | 0.3790 | 29.185 | 1.706
1 | SE | NA | NA | NA | 0.81 | NA | NA | 1000 | 0.753 | 0.388 | 0.0491 | 1.272 | NA

LEGEND
   Session Session identifier
      Stat Statistic (e.g. SE, P, LCL, UCL)
 Estimator Name of closed-population estimator, mostly after Otis et al. (1978)
      Npar Number of parameters in closed-population model
       AIC Akaike's Information Criterion for closed-population model
      Nhat Closed population estimate N-hat using 'Estimator'
      phat Per occasion capture probability implied by N-hat
      RPSV Sqrt(spatial variance of capture locations) (m) pooled over individuals
    IPCode IP result code (OK on 'Est' line indicates successful completion)
    IPDens Density estimated by inverse prediction
     IPAdj IPDens with SE adjusted for spatial variance
      IPg0 g(0) estimated by inverse prediction
   IPSigma sigma estimated by inverse prediction
    IPTime Inverse prediction elapsed time (minutes)
Upper bound for Nhat = 100 x M(t+1)


Orongorongo Valley possum example ML SECR log

Example output – Brushtail possum Trichosurus vulpecula

This is an extract from the log file following ML SECR analysis of the possum data from session 49 (here referred to as 'session 1') with DENSITY 4.1.1. Default settings were used.

ML SECR model
  Detector type                : Single live
  Detection model              : Halfnormal
  Likelihood                   : Full
  Distribution                 : Poisson
  Within-session model         : g0[.]s[.]

  Model spans                  : Session 1 only

WARNING : detector type (single-live) does not match likelihood (multi-live)
Expect bias in g0-hat

ML SECR results
  Number of parameters total   : 3
  Number of parameters fixed   : 0
  Number distinct histories    : 225
  Log likelihood               : -1579.7484
  AIC                          : 3165.4969
  AICc                         : 3165.6050

   Parameter       Value    SE.Value      Link    Par.Name    Estimate          SE         LCL         UCL
           1     2.60962     0.06977       Log     Density    13.59391     0.94966    11.85639    15.58606
           2    -2.20121     0.09370     Logit          g0     0.09964     0.00841     0.08433     0.11737
           3     3.30747     0.03527       Log       Sigma    27.31601     0.96373    25.49150    29.27109

Note: "Value" refers to parameter value on link scale
Note: The likelihood was evaluated 124 times during maximisation


PG covariate

PG is a special individual covariate used to input data from a parallel radiotelemetry study. It is expected that for every individual captured there is a measure PG (for 'proportion of time on grid') equal to the proportion of the animal's activity that is in the vicinity of the traps.This is used to form an estimate of density after the fashion of White & Shenk 2001: D-hat = mean(PG) x N-hat ÷ A. [Details of the method will be given elsewhere]

PG is appended to lines of the capture file along with other individual covariates. The individual covariate corresponding to PG is selected with the filter in Options | Closed N | Radiotelemetry.


Population estimators

These closed-population estimators are available in DENSITY
Estimator | DENSITY name$ | Model | Maximum likelihood | Details
Number caught @ | N_caught | – |  | Also denoted S and M(t+1)
M0 Null | Null | M0 | Yes | See Otis et al. 1978 p. 105
Mt Darroch | Darroch | Mt | Yes | See Otis et al. 1978 p. 106
Mb Zippin | Zippin | Mb | Yes | See Otis et al. 1978 p. 107
Mh 2-point mixture * | Mh2 | Mh | Yes | Pledger 2000
Mh Beta-binomial | MhBeta | Mh | Yes | Dorazio & Royle 2003
Mh Jackknife | Jackknife | Mh |  | Burnham & Overton 1978, Rexstad & Burnham 1991
Mh Chao | Chao_h | Mh |  | Chao 1987
Mh Chao Modified * | Chao_mod | Mh |  | Chao 1987
Mth Chao coverage 1 | Chao_th1 | Mth |  | Sample coverage Lee & Chao 1994
Mth Chao coverage 2 | Chao_th2 | Mth |  | Sample coverage Lee & Chao 1994
Huggins linear logit | Huggins | Various | Yes | Huggins 1989

* Estimators marked with an asterisk are best avoided for IP SECR because they throw occasional extreme values that inflate the variance of density estimates.
$ Where a one-word code is needed
@ Not a capture–recapture estimator, but can be applied to input data in the standard format

References


Population size from SECR models

Sometimes we care more about population size than density. SECR often does a better job of estimating population size than conventional (non-spatial) methods (Efford and Fewster 2012). When the area of interest is the same as the area of integration (a mesh of known area A in DENSITY) the estimate of N is simply A times the density estimate. If we are interested in the expected number of home range centres, the sampling error is also a simple multiple. If we are interested in a particular realisation of the population process, the estimate is the same, but its sampling error is less.

DENSITY 5.0 reports the expected population size in the area of integration (MLEN). The sampling error of the realised population and its error are not computed directly (cf Efford and Fewster 2012 and region.N in the R package 'secr'). However, an exactly equivalent estimate is obtained by setting Distribution model to 'Binomial' in Options | ML SECR. i.e. the sampling error and confidence intervals for expected N (MLEN) under this model match those for realised N under a Poisson model.

TIP Remember that the estimate you get for N relates to the area of integration, which depends on the buffer setting and mask if one is in use.

References


Preview trap file

Display the trap layout in the current trap file. Activated from View on the main menu or by double-clicking within the border of the 'Trap layout' box. Useful for checking trap locations when there is no valid capture file (and hence 'Read data' does not work).

Properties of the trap layout are updated on the status bar at the bottom of the screen. Some options (e.g. 'Label trap sites') are available on the map popup menu.

Trap preview is cancelled by the 'Read data' or 'Reset' tool buttons.


Progress panel

progress

The progress panel appears on the main screen when you click GO or GO all. For ML SECR, each likelihood evaluation is shown in turn. For IP SECR, progress is shown through successive points of the experimental design, and through the replicate simulations used to obtain the variance.

progress done
Right-clicking on the panel brings up a pop-up menu with the option to clear (hide) the panel. For ML SECR the menu also allows you to write all likelihood evaluations to the log, at any time during maximisation or on completion, and on completion to -
  • copy estimates to the clipboard (along with AIC etc.)
    session model npar loglik AIC AICc D SE(D) g0 SE(g0) sigma SE(sig) b SE(b) Date Time
    1 g0[.]s[.] 3 -643.70 1293.41 1293.92 12.072 0.420 0.0792 0.0115 31.59 1.60 NA NA 01/12/12 18:44

  • copy an R function to the clipboard that will reproduce the detection function:
    detectionfn <- function (x) 0.0792 * exp ( -x^2 / 2 / 31.59^2)
Use the R function like this to generate a plot :
[paste function at R command prompt]
xv <- 1:80
plot(xv, detectionfn(xv), xlab = 'Distance', ylab = 'Probability of detection', type = 'l', ylim = c(0,0.1))

detectionfn


Pxy contours

DENSITY displays a map of spatial variation in individual capture probability. Capture probability is measured as

where gxy(j) is the daily (per occasion) probability of capture in trap j of an animal located at coordinates x,y. The method ignores competition with other animals for traps (cf. simulation of trapping). The values gxy(j) are function of the distance between x,y and the trap (see Detection function).

The parameters used for gxy are those for g0 and σ in the 'Demonstration parameters' box. For contouring, Pxy is evaluated at a grid of points across the current trap map. Click on a contour to highlight it; the selected contour level is shown by a highlighted vertical line on the graph of Pxy vs Area (below). The contour map has its own popup menu (below) that may also be accessed by right-clicking on the Pxy contours button.

Example of 5% Pxy contour map for an irregular trap line.

Tip : To access options from the map popup menu (such as 'grid lines'), use the shortcut key <Ctrl M> or the View menu.

An accompanying window contains one of three plots. Use the popup menu (below) to switch between them.

Pxy vs Area

Plot of the area within decreasing contours of Pxy.

CV(Pxy) vs Area

Plot of the CV of capture probability for successively more inclusive definitions of the study population. In this case the CV reached 55% among animals within the lowest contour (Pxy > 0.05).

pdf(Pxy)

This plot approximates the distribution of individual capture probability for all values that fall within the lowest contour.

Pxy popup menu

Set demo parameters | Open 'Demonstration parameters' input box
Copy to clipboard | Copy Pxy vs Area plot; may then paste into MS Word etc. Use Map popup to copy contour map.
Pxy per session | By default Pxy is calculated per occasion. Pxy may also be expressed on a per-trapping-session basis (i.e. the probability of being caught at least once during the trapping session). Duration of the trapping session is inferred from the currently loaded capture data. These values are distinguished by an additional subscript for the duration (e.g. P5xy for a 5-occasion session). Click to toggle between these options.
Copy data to clipboard | Copy data for bar height in pdf plot
Contour interval % | Vary contour Pxy interval (default 5%)
Pxy vs area | Optional plot
CV(p) vs area | Optional plot
pdf(Pxy) | Optional plot
Tick length | Adjust graphs ticks (range 0-1).

The contour algorithm is ACM Transactions in Mathematical Software Algorithm 531 (Snyder 1978).

References


Radiotelemetry

Radiotelemetry of captured animals allows a naive estimate of density to be corrected for edge effect:
D-hat = (N-hat ÷ A) x mean(PG(i))
where PG(i) is the proportion of time spent by animal i within some designated polygon of area A. PG(i) is input as an individual covariate in the 'capture data' file.

Capture file covariate number | A capture file may include several covariate fields. Select the one to use as PG (default = 0, i.e. none)
Polygon type | Grid hull | PG is the proportion of radio fixes within the polygon formed by the outermost trap sites
 | Concave | PG is the proportion of radio fixes within an arbitrary radius of a trap. The radius is set by the user. The boundary polygon is potentially concave, but will not always be so.

'Mesh' determines the precision of area estimates when the 'Concave' option is used. A small mesh (e.g. 1 m when trap spacing = 30 m) is precise but slow.

WARNING: These methods are new and relatively untested (but see White and Shenk 2001, Grant and Doherty 2007). An unbiased estimate of density is expected only when every trapped animal is radiotracked.

References


Recode detector type

Recode a trap layout file with trap-by-trap detector information by changing all instances of a particular value of the integer detector code to another detector code.

The user is prompted for the file name and asked to confirm an example before the file is rewritten.


Recode occasion number

Increase the occasion number of all captures in a capture file by a constant amount. For example, adding 6 days to a file with occasions numbered 1-5 results in a file with occasions numbered 6-10. Useful for creating a combined file from two consecutive trapping periods (i.e. recode the second period so that occasion numbers follow in sequence from the end of the first period).

The user is prompted for the file name and asked to confirm an example before the file is rewritten.


Import XY capture data

This data tool imports a fixed-format capture file in which all captures of an animal are coded on a single line:

SessionID AnimalID X1 Y1 X2 Y2....Xt Yt

X1Y1 is the capture location on occasion 1, X2Y2 is the capture location on occasion 2, etc. Non-capture is indicated by zeros in both X and Y fields, which must each occupy the same fixed width. The user is prompted for the number of capture occasions, the width of the X and Y fields, and the number of spaces between AnimalID and the start of the first X field.

For example, given a fixed width of 2, the record
1  2  02030000010410100909
is read as: in session 1 the animal with ID '2' was caught at (2,3) on the first occasion, (1,4) on the third, (10,10) on the fourth and (9,9) on the last.

Loss of an animal may be indicated by appending an integer code <9. For example, animal 3 died while being handled on occasion 3:
1  3  01030000010400000000 -1

The user is prompted for the output file name and asked to confirm an example before the file is rewritten.

Tip: Data in the 'XY complete' format of Program CAPTURE may often be imported directly with this tool, or after minor editing of the initial columns.


Reformat old trap file

This menu option provides a simple way to :

  • Add a trap ID code (1...N(traps)) to each row in a trap file that consists only of X-Y coordinates
  • Reformat a file with columns X Y TrapID to the order required by the new format TrapID X Y.

The user is prompted for the file name and asked to confirm an example before the file is written. See also: Trap file format


Re-scale density from pooled sessions

Pooling sessions (Session filter) has the side effect of giving an aggregate density rather than an average density. When 'Re-scale density' is ticked, the output density is divided by the number of distinct sessions that were pooled, giving an average over the pooled units.

At present, no estimate is available for the variance among sessions.

TIP: The denominator (the number of sessions or units pooled) is output in the field NSess.


Residence time

Residence time (aka stopover duration) is a property of particular interest for migratory species such as salmon (in spawning streams) and many song birds (in transit between wintering and breeding grounds). DENSITY applies some of the published estimators and enables their performance to be simulated. Mostly these are derived from estimates of apparent survival φ.

Estimator | Explanation | Reference | Comments
-1/ln(φ) | Classic estimator of life expectancy | Cormack 1964 | Assumes steady state
Sb + Sa | Sum of components intended to measure life expectancy 'before' and 'after' first capture. DENSITY implements both the aggregate estimate (Eqn2 in the original paper) and the time-specific estimates (Eqn 4). | Schaub et al. 2001 | Logic shakey (Efford 2005) From DENSITY 4.1, only Sa is reported
R | Based on 'area-under-curve' statistics from Schwarz & Arnason 1996 Jolly-Seber model. | Manske & Schwarz 1999 | Assumes sampling spans a complete population pulse
Minimum duration | Average time elapsed between first and last captures, over all individuals recaptured |  | Biased, but often less so than other estimators

Departure from stopover sites is likely to depend on time since arrival - see Pledger et al. (2008) for new methods to deal with this.

References


Rotate traps

Permanently generate new X-Y coordinates for trap sites by rotating the entire array by a given number of degrees around the centre defined by the mid-ranges of the X- and Y- coordinates.

Rotated trap layouts may lie better in the rectangular arena. Impoves the efficiency of simulations animals (IP SECR) and 2-D integration (ML SECR). The same effect may be achieved by rotating trap locations 'on the fly' - see Options | Input | Trap layout.


SECR

Spatially explicit capture–recapture (SECR) refers to capture–recapture with locational data (X-Y grid coordinates) for each capture. The primary aim of SECR is to estimate and model the density of free-ranging animals. Background papers are Efford (2004), Efford et al. (2004), Borchers and Efford (In review), and Efford et al. (In review).

References


Separate ID

When pooling data from different sessions with a session filter it is sometimes appropriate to combine the datasets as if all animals were unmarked at the start of each session after the first. This is the case when pooling consecutive sessions for greater precision in closed-population analyses (e.g. Efford et al. 2005).

DENSITY achieves this by optionally applying a session prefix ('XX.' where 'XX' is the session number) to each animal ID.


Session

What is a 'session'?

DENSITY uses the term 'session' for a closed-population sample. A session usually includes capture data from several closely-spaced capture occasions (often consecutive days). Each 'primary session' in the 'robust' design of Pollock (1982) is treated as a session in DENSITY. Clicking 'GO all' causes DENSITY to perform independent closed-population analyses for each session in turn. For non-spatial open-population analyses (a minor feature of DENSITY) 'sessions' are assumed to be ordered in time, with population turnover (births and deaths) in the intervals between sessions.

So far, so good. The catch is that DENSITY also uses 'session' for independent subsets of the capture data distinguished by characteristics other than sampling time (as above). For example, two grids trapped simultaneously could be analysed as distinct 'sessions' if (i) they were far enough apart that there was negligible prospect of the same animal being caught on both grids, and (ii) there was interest in comparing estimates from the two grids. Equally, males and females could be treated as 'sessions', or each sex x grid combination could be treated as a 'session'.

For many purposes, 'sessions' in DENSITY are identical to 'groups' in MARK (see also Lebreton et al. 1992, Williams et al. 2002 p. 426). The usage entered DENSITY originally as a convenient way to schedule analysis of closed-population estimates from a chain of 'robust-design' samples. DENSITY allows complex 'between-sessions' models that share some or all parameters between sessions. One possible 'between-session' model is a linear or logarithmic trend; this is only likely to make sense if the 'sessions' in fact form an evenly spaced temporal sequence. Putting it another way, trend models assume a between-session covariate with the values 1, 2, ...n(sessions).


Session filter

Select or amalgamate data from particular capture sessions.

List the sequence numbers* of sessions to be included (separate by blanks or commas). Runs may be indicated by a hyphen '-'. Enclose sessions to be combined as a single session within square brackets. Combined sessions receive new a identifier such as '1-3'.

Example: [1-3] [4-6]
(temporarily combine sessions 1,2,3 into one new session, and sessions 4,5,6 into a second new session)

* Sessions are usually identified by a text label. 'Sequence number' here refers to the order in which sessions first appear in the capture input file.

TIP: After 'Read data', check the Summary tab to verify the filter has the effect you intended.
TIP: Although 'Session' appears to refer to samples sequential in time, sessions may equally be different spatial units (e.g. trapping grids).

WARNING: Session filters and session-specific trap files cannot safely be used together


Session - CAPTURE

Running the Capture program is as simple as selecting a task from the popup menu and clicking RUN.


Session - ETA density

DENSITY does not use an effective trapping area (ETA) for density estimation, but users are free to try their favourite boundary strip width W.

Polygon method

Two methods are provided for applying a boundary strip W. The default ('Convex') is to form a buffer W metres outside the convex hull of the trap sites. The alternative method is to include all sites within W metres of a trap ('Concave'). The two methods give similar results for compact grids with W >> trap spacing. 'Convex' is the method commonly used, but the concave option is more useful when traps are sparsely and irregularly placed. The 'concave' method resembles buffering in a GIS. The algorithm used in Density is to find the W contour of distance to the nearest trap. The 'convex' method works by generating a large number of potential perimeter points in a circle of radius W about each trap and finding the minimum convex polygon that encloses them. The chosen polygon method is also applied when calculating automatic initial values for inverse prediction.

Effective trapping area: concave polygon 12.5 km2

Effective trapping area: convex polygon 15.1 km2

WARNING: When a habitat mask is in use ( Options | Habitat mask ) the ETA is not reliable

See also Effective trapping area and boundary strip methods for density, and Session - movements for the calculation of ARL.


Session - MLE(N)

Detailed statistics appropriate to each MLE model for closed population size.


Session - Movements

Reports home range statistics and various diagnostic plots of movement.

If zero truncation is ticked in Options | IP SECR - Advanced the d-bar statistic reported here will use only positive distances moved. This is indicated by an asterisk (*).

Plot range length

'Plot range length' displays a graph of trap-revealed range length versus number of captures. The curve is fitted by nonlinear least squares. Its asymptote is the 'asymptotic range length' ARL (cf Jett and Nichols 1987).

Monte Carlo tests

Successive detections of each animal are assumed in the SECR models to be independent. The statistics P(d=0) and t2/r2 indicate deviation from independence. Their statistical significance may be assessed by simulating a large number of samples from the fitted SECR model.

Populations are simulated in the current buffered area and sampled using a halfnormal detection function with the current detector array and number of occasions.

TIP: automatic values for D, g0 and sigma may be obtained by clicking 'Auto' in the demonstration values box that drops down on the main form when the Animals toolbutton is clicked.

P is the probability of observing a larger value of the test statistic.

Radiotelemetry

Radiotelemetry refers to a specialised analysis combining trapping with telemetry of individual movements.

References


Session - Population

Session population estimates

Select a closed-population estimator. If this estimator is likelihood-based then see the MLE(N) tab for more detailed results.

TIP: The estimator selected here is mirrored in 'Options | Closed N' and is the one used as a predictor for IP SECR.


Session statistics

The Session Statistics panel appears on the right of the screen when data have been loaded with 'Read data'.

Tabs display closed-population results for the currently selected session:

Population | Choice of population estimator and immediate results
Summary | Count statistics, capture histories
Movements | Home-range diagnostics
ETA density | Conventional boundary-strip calculations and related tools
Capture | CAPTURE interface
MLE(N) | Details of closed population maximum likelihood estimates, including profile likelihood and pdf for Mh2 and MhBeta models

The button takes you directly to 'Options | Closed N'. 'Root pooled spatial variance' is a measure of the scale of trap-revealed movements.

See also Examples

Side effects

The session statistics panel is primarily for screen output, but there are two side effects. 'Estimator' settings are used for IP SECR when you click 'GO' or 'GO all'. The 'Polygon method' in Movements affects automatic initial values.


Session - Summary

Session summary statistics

Raw statistics for captures in the selected session. The notation follows Otis et al. 1978:
n(i) | Number of animals caught on occasion i
u(i) | Number of unmarked animals caught occasion i
f(i) | Number of animals caught exactly i times
M(t+1) | Cumulative number of different animals caught
Losses | Number of animals removed

The 'Capture histories' button displays data for this session in 'capture history' format. Use Data | Export capture histories for other formats.


Simulated radio fixes in polygon

Simulation - radio fixes in polygon

The possibility of combining radiotelemetry data with trapping data to estimate population density is largely unexplored (but see Eberhardt 1990, White and Shenk 2002, Grant and Doherty 2007).

DENSITY includes some simulation capability that allows these methods to be evaluated.

The assumed experimental design is
  • Conduct a closed-population capture-recapture study with a known trap layout
  • During the trapping, attach a radio to every animal caught
  • After traps are closed, obtain a sample of radio fixes for each animal (these are assumed to be independent samples from the activity distribution of each animal)
  • Calculate an estimate of population size from the trapping data (N-hat)
  • Calculate for each animal the proportion of radio fixes that lie within the perimeter* of the trap layout, and take the mean over animals (PG-bar)
  • Estimate density D-hat = (N-hat / A) x PG-bar, where A is the area of the perimeter polygon. Variance estimates follow Grant and Doherty (2007).
The closed population analyses are available automatically in DENSITY. Here we consider how to simulate a sample of radio fixes. To minimise the clutter of new options we assume the detection function ('Options | Simulated population') is an adequate description of home range (in the long term other range options will be considered). It is assumed that an equal number of fixes is obtained for each animal captured. A sample from the required 2-D distribution is obtained by a rejection method (Ripley 1987); candidate points have a random uniform distribution within ± m.σ where m is a multiplier selected by the user (default m = 4.0).

Estimates are returned in the Simulation fields PGmean, PGDens and PGseDen. To conduct a radiotelemetry/capture-recapture simulation, tick the 'Sample radio fixes' box in Options | Simulator and select these fields in the simulator field list.

* DENSITY generalises this to any polygon defined in relation to the traps.

References


Simulated Population Advanced

Simulated population | Advanced

Here are several specialized settings:
Intermittent availability
Overdispersion c
Escape rate
Mortality in traps
Bimodal home ranges
Truncation radius

Intermittent availability

Animals may be unavailable for detection if they are sometimes submerged, do not vocalize etc. These parameters define a Markov model for switching between the available and unavailable states.

Overdispersion c

Standard errors, confidence intervals and model selection criteria of capture-recapture models may sometimes be adjusted for lack of fit due to unstructured heterogeneity or non-independence, using a variance inflation factor c (e.g. Lebreton et al. 1992). Possible estimators of c are discussed by White (2002) and Cooch & White (2006: Chap 5). Density does not yet use these methods, but it provides various means of simulating overdispersion. One mechanism is 'cloning' capture histories: independently simulated capture histories are repeated a fixed number of times to generate a known degree of non-independence (see Anderson et al. 1994 for an example).

The value c controls the number of repeats. By default, c = 1 (no repeats, no overdispersion). Values of c > 1 cause overdispersion (expected number of repeats > 0). Non-integer values of c are accommodated by choosing the integer number of repeats randomly for each simulated individual from the nearest integer values to provide the desired mean.

Cloning is applied after the population generation and sampling steps, and independently of them. Thus cloning increases the total size of the sample (and the implied population size). It is necessary to anticipate this effect by a reciprocal adjustment of population density or population size. For example, to simulate population samples that differ only in the overdispersion one could use:

Expt | Density | c
1 | 10/ha | 1
2 | 5/ha | 2
3 | 2.5/ha | 4
In each case the realised density is 10 / ha.

Escape rate

Animals that escape from a single-catch trap are undetected (unless caught in another trap), but as a side effect no other animal may be caught in the sprung trap on that occasion.

Specify the probability that a capture event has this outcome.

Note: Trap 'state' (whether a trap was empty, caught an animal, or was sprung) is not recorded as such, and is not used in analyses. Consideration should be given in future to using the frequency of 'sprung' traps as an auxiliary variable.

Mortality in traps

A fixed probability of removal is applied at each capture (the default rate is 0). Animals that are removed are counted as 'Not released' and coded with a negative occasion number if the data are exported.

Bimodal ranges

The detection functions fitted by SECR are radially symmetrical: contours of equal probability of detection are circles around the range centre. In general, this is true also of the simulation algorithm in Simulator. The one exception is a facility for simulating detection of animals with bimodal, 'dumb-bell shaped' home ranges. Each mode is assumed to have the same scale parameter sigma. Two parameters are specified: the proportion of activity associated with the second mode, and distance between the modes in metres.

For each simulated animal, Density places the first mode at random, and then places the second mode in a random direction at the required distance. Detection probability is the sum of the probabilities of detection in each mode, weighted by the proportion of activity in that mode.

Warning: The method is implemented only for halfnormal detection

Truncation radius

This setting modifies the shape of any spatial detection function by truncating it at the given radius.


Simulated Population Dispersion

Simulated population | Dispersion

Spatial populations may be simulated from several different distributions as specified on the 'Dispersion' tabbed page. Remember that the overall density is set on the 'General' page. Existing SECR estimation methods fit only the Poisson distribution.

Poisson (default) | Random uniform distribution Example: D = 5/ha, trap spacing 30 m
Poisson X-gradient | Inhomogeneous Poisson distribution with gradient in expected density from zero at the left edge of the buffered area to 2 x D at the right edge.
Even | Divide the simulation arena into square cells such that placing one animal in each cell provides the desired density (these cells have side 100/√D m, where D is in animals/ha). Assign each individual a uniform random location within its cell. The overall simulated population size is not constant because animals in cells that overlap the edge of the arena may fall inside or outside the arena.
Clustered | Neyman-Scott distribution. Animals occur in randomly located clusters of mean size mu. Location relative to the cluster centre is circular normal with scale parameter (σ) h. Toroidal wrapping is used to keep all locations within the frame. Both the total number and the number per cluster are Poisson-distributed. Example: D = 5/ha, mu = 10, h = 20 m
Sequential inhibition | An alternative 'even' distribution. Random Poisson points are placed sequentially, with the rule that none lies within the inhibition radius of any previously placed point. Example: D = 5/ha, inhibition radius 30 m (the trap spacing in this example)


Simulated Population g0(tbk)

Simulated population | g0(tbk)

simulated population g0tbk

No further information


Simulated population – groups

The 'Group' button is enabled once you have added one simulated population to the 'Simulated population' stack. Each time you click the button, a new group of animals is added to the population for the current experiment. Groups may represent classes that are distinguishable in the field (e.g. male vs female), but they also may be used for cryptic classes that introduce heterogeneity, as in finite mixture models for capture probability (e.g. Pledger 2000).

Note: Statistics that later require a single value of the 'true' parameter (e.g. RB(g0-hat)) are calculated using an average weighted by the densities of the two groups.

References


Simulated population – heterogeneity

The parameters p, g0, σ and φ may vary among individuals in the population - select a continuous distribution from the dropdown box and specify the required CV. For example, you may wish to sample g0 from a beta distribution with a mean = 0.2 and CV = 40%:

simulated population heterogeneity

TIP: Right-click on the mean or CV boxes to see a plot of this distribution the probability density function is overlaid on a histogram of simulated values (sample size equal to the current 'Replicates per experiment'). The number above the graph is the mean of the simulated values.

See also groups


Simulated Population Movement

Simulated population | Movement

simulated population movement

No further information


Simulated Population Parameters

Simulator – Population parameters

Settings here divide broadly into 'essential' and 'other'.

The essential parameters differ depending on whether your simulation is spatial or non-spatial, and whether the population you are simulating is open or closed:

 | Closed | Open (default λ=1)
Non-spatial | N, p | N, p, φ
Spatial | D, g0, σ | D, g0, σ, φ

N | population size
p | capture probability
D | population density
g0, σ | parameters of detection function
φ | survival rate between sessions

Population size N or density D may either be fixed at the expected value or allowed to vary as a Poisson variate.

TIP: For non-spatial simulations, set the detection model to 'Nonspatial' under 'DETECTION MODEL'


Simulated population Resample capture data

Simulation - Resampling an existing capture file

Resampling is a specialised alternative to de novo simulation of capture data. Data from an intensive study (or simulation) may be subsampled to address questions like "Would the precision have been adequate if I had used fewer traps, or trapped on fewer days, or if the population density had been lower?". Resampling is dynamic: a new sample is drawn 'on the fly' for each replicate.

Select 'Resample' in the 'Detection model' drop-down box for the simulated population. An additional tabbed page will appear, and all other settings for 'simulated population' will be disabled.

The capture file may use either the TrapID or Nonspatial formats.

Resampling may select or discard either whole capture histories (all records of one animal) or particular capture records. Thinning a proportion of capture histories is equivalent to simulating a population of lower density. Thinning capture records is equivalent to simulating lower detection probability (g0).

The size of the sample is chosen from these options:
Option | Description | Related parameter
Fixed sample size | Exactly n records or capture histories are selected at random for inclusion in the population file. If n equals or exceeds the number in the input file then all records are used | Sample size
Proportion | Exactly n records are selected, as for 'Fixed sample size', but n is specified as a proportion p of the number N in the input (n = p.N). n is rounded to the nearest integer. | Sampling fraction
Binomial probability | Records are included with binomial probability p. The number will vary. | Sampling fraction

Sampling maybe with or without replacement; repeats are possible when sampling with replacement.

The settings described so far define a 'simulated population' as a pool of capture records that is a random subset of the input capture file (possibly the entire set). All trap locations and sampling occasions (days) are potentially included. Use the 'Trapping and estimation' settings to restrict the trap locations or occasions. Analyses may be performed with trap layout files that contain any subset of the original locations. Use Trap Builder | Input from file to create layout files with a subset of locations.

Resampling a population from a capture file (in Simulated population) may also be combined with dynamic subsampling of the trap layout (in Trapping & Estimation | Advanced).

WARNING: sampling capture histories is not a reliable way to simulate lower density if detection parameters (g0, σ) vary with density, or if there is competition for traps.

References


Simulated Population Turnover

Simulated population | Turnover

This tabbed page appears only when an open population is sampled (see Trapping & Estimation)

simulated population turnover

No further information


Simulation output

Simulation output is provided for a list of 'fields' summarised with 'statistics' (mean, SE etc.). Fields and statistics are selected by the user. Output appears in a text file ('View Report' button).

Summary statistics

*Statistics marked with an asterisk are available for only a subset of fields.
N | Number of valid values (≤ number of replicates)
N(0) | Number of zero values
Min | Smallest valid value
Max | Largest valid value
Mean | Mean of statistic
SD | Standard deviation
SE | Standard error (SD/√N)
Median | Median
P025 | Lower 95% empirical confidence limit (N replicates must be large)
P975 | Upper 95% empirical confidence limit (N replicates must be large)
CV% | Relative precision as a percentage, averaged over N replicates*
seCV% | Standard deviation of CV% over N replicates*
RB% | Relative bias as a percentage, averaged over N replicates*
sdRB% | Standard deviation of RB% over N replicates*
COV | Coverage of confidence interval, as a proportion* (i.e. the proportion of intervals that contain the true value)
RMSE | Square root of mean squared error
Spacer | A dummy 'statistic' used to insert a line space between experiments

Fields

Label information only
 | Expt | Experiment number.
 | Repl | Replicate number (detail lines only)
 | Session | Session number (multi-session only)
 | Traps | Sequence number of trap file (0.. ntrapfiles–1)
 | Stat | Name of summary statistic (summary lines only)
General statistics
 | NCapt | Total number of captures in a session, including recaptures
 | NAnimal | Number of distinct individuals caught in a session
 | NRecapt | Number of recaptures (NCapt – NAnimal)
 | NotRlsd | Number not released (removed)
 | TS% | Trap success: the percentage of traps that caught an animal (N = number of occasions (days) x number of traps).
 | CumTS% | Cumulative trap success: the percentage of traps visited at least once during the trapping session (N = number of traps).
 | Disturb | Disturbance rate: the proportion of traps inactivated by disturbance
Movement
 | RPSV | Root pooled spatial variance defined
 | dbar | Unweighted mean distance between successive captures di of the same animal within a session (Σdi / n where n is the number of recaptures of all animals)
 | sedbar | Standard error of d-bar
 | Pzero | Proportion of recaptures in the same trap as the last
 | t2r2 | Schoener's statistic t2/r2 for serial correlation, pooled over animals more
 | MMDM | Mean maximum distance moved more
 | ARL | Asymptotic range length more
Closed population
 | Npar | Number of estimated parameters for closed population estimate
 | LogLik | Log likelihood for closed-population estimate if likelihood-based
 | Nhat | Closed-population estimate (see Trapping and estimation)
 | seNhat | Estimated standard error of closed population estimate
 | CVNhat | Precision of N-hat estimated as seNhat / Nhat
 | CIWidth | Width (length) of confidence interval for Nhat
 | phat | Estimated capture probability per occasion (day) implied by Nhat
Inverse prediction estimates IP SECR
 | IPDens | Intensity of spatial point process D
 | IPseDen | Prediction standard error of IPDens
 | IPAdjSE | SE of IPDens adjusted for spatial variance
 | IPCVDen | Precision of Density estimated as IPseDen / IPDens
 | IPCVAdj | Precision of Density estimated as IPAdjSE / IPDens
 | IP g0 | Core individual trappability g0
 | IPseg0 | Prediction standard error of g0
 | IPSigma | Spatial scale of detection σ
 | IPseSig | Prediction standard error of IPSigma
 | IPInfrW | Inferred boundary strip width
 | IPTrueD | True local density, estimated for each realisation by the actual number of home range centres within the effective trapping area from IPInfrW.
Maximum likelihood fit of spatial detection model ML SECR
 | MLnpar | Number of fitted parameters
 | MLloglk | Maximized log likelihood
 | MLDev | Deviance
 | MLdf | df of deviance
 | MLesa | Effective sampling area (sense of Borchers and Efford 2008)
 | MLDens | Intensity of spatial point process D
 | MLseDen | Asymptotic standard error of MLDens
 | MLg0 | Core individual trappability g0
 | MLseg0 | Asymptotic standard error of ML g0
 | MLSigma | Spatial scale of detection σ
 | MLseSig | Asymptotic standard error of MLSigma
 | MLz | Shape parameter of hazard-rate detection model
 | MLsez | Asymptotic standard error of MLz
 | MLEN | Expected number of individuals in masked area
 | MLInfrW | Inferred boundary strip width (cf IPInfrW)
Ad hoc density estimates
 | WDens | Using boundary strip 'effective trapping area'
 | WseDen | SE of WDens
 | PGmean | Proportion of fixes within grid (or other area)
 | PGDens | Density estimated from PGmean details
 | PGseDen | SE of PGDens
True values (for verifying simulations)
 | TrueN | Actual population size (non-spatial simulations only)
 | Truep | Actual mean capture probability (non-spatial simulations only)
 | TrueCVp | Actual variation in capture probability (non-spatial simulations only)
 | Trues | Mean of individual home-range sigma (of interest when distribution not 'Constant')
 | TrueCVs | CV of individual home-range sigma (CV>0 when distribution not 'Constant')
 | TruePhi | Mean of individual phi (of interest when distribution not 'Constant')
 | TrCVPhi | CV of individual phi (CV>0 when distribution not 'Constant')
Open population analyses
 | NJS | Jolly-Seber population size
 | seNJS | Standard error of NJS
 | NJSLCL* | Lower confidence limit (NJS)
 | NJSUCL* | Upper confidence limit (NJS)
 | NJSBS | Mean of bootstrapped values (NJS)
 | PJS | Jolly-Seber capture probability, or CJS recapture probability
 | sePJS | Standard error of PJS
 | BJS | Jolly-Seber births (recruitment)
 | seBJS | Standard error of BJS
 | Phi | Jolly-Seber or CJS apparent survival
 | sePhi |
 | PhiLCL* |
 | PhiUCL* |
 | PhiBS |
 | covPhi | Covariance of successive phi
 | Gamma | Pradel seniority
 | seGam |
 | GamLCL* |
 | GamUCL* |
 | GamBS |
 | Lambda | Relative population growth rate
 | seLam |
 | LamLCL* |
 | LamUCL* |
 | LamBS |
 | JSbeta |
 | seJSB |
 | LambdaK | Lambda estimated by ratio N(t+1) / N(t) (closed population estimates)
 | LamKse |
 | MNA | Minimum number alive
Trend
 | Trend | Fitted slope of linear trend in the chosen response variable
 | seTrend | SE of slope
 | TrLT0 | Indicator for whether slope was signficantly less than zero using a t-test with the alpha level in Options | Output. the mean of TRLT0 over replicates is an estimate of power (1 - β) for a one-sided test.
 | TrGT0 | Indicator for whether slope was signficantly greater than zero using a t-test with the alpha level in Options | Output. the mean of TRGT0 over replicates is an estimate of power (1 - β) for a one-sided test.
Miscellaneous
 | Day0 | Number of first occasion on which no animal was caught
 | SampleC | Estimated sample coverage (Chao et al. 1992)
 | ... | Other undocumented values not of general interest
 | AutoD | Density from automatic initial value algorithm
 | Autog0 | g0 from automatic initial value algorithm
 | AutoSig | sigma from automatic initial value algorithm
 | Rseed | Random seed
 | Exetime | Execution time

* See Options | Open population for confidence interval method


Simulation PAU

Simulation - Proportion of area used

The theory of site occupancy has recently been developed in relation to discrete sites that might be natural units of habitat or even islands (Mackenzie et al. 2002 and later references). The same models have also been used to estimate the proportion of an area used by a species (PAU), given a probability sample of points within a region. Using 'point' samples in this way is problematic as the proportion of sites at which a species is detected over a sequence of visits will be affected by the mobility (home range size) of the species, and by the distance from which individuals are detected. Although there may be some questions and scales for which these are not important effects, there are others (e.g. detection of population trend by the North American Breeding Bird Survey) for which it is far from clear that this is the case.

This is the motivation for simulating occupancy estimates of PAU in the presence of home-range movements and detection-at-a-distance.

Simulation in DENSITY provides the necessary machinery for simulating range centres and detection at an array of points ('traps'). For simulating PAU we also need a home-range model and a strict definition of when a site is 'occupied'. Options for home range models are defined in Simulation | Simulated population | Dispersion under 'Movement during sampling'. The present choices are a circular bivariate normal ('halfnormal') model or a circular uniform model, each with scale parameter σ defined as for detection functions.

The circular bivariate normal does not have a definite boundary, so it is necessary also to specify a threshold of usage (probability density) that a site must exceed to be considered 'occupied'. The threshold is expressed as a proportion of 'g0', the peak (intercept) of the probability density function. A site is 'occupied' when the sum over individuals of predicted usage exceeds the threshold.

The proportion of 'occupied' sites is evaluated by placing a square mesh across the buffered area with mesh spacing small enough to give 2/tolerance sample points, where 'tolerance' is the requested tolerance for PAU (default 0.0001). Output is in the Simulation field 'PAU'. Select 'Calculate PAU' in Options | Simulation.

References


Simulation terminology

A sampling design is defined by the trap locations, the trap type(s), and the number of occasions (days).

Estimates refers especially to inverse prediction estimates of D, g 0 and σ, although others are reported. Estimates are distinguished from the parameters they estimate by a 'hat'. 'θ' is used here to mean any parameter (D, g 0 or σ).

Precision is measured by the coefficient of variation of the estimate:
CV(θ-hat) = SE-hat(θ-hat)/ θ-hat.

Bias is measured by the relative bias of the estimate:
RB(θ-hat) = (θ-hat – θ)/θ-hat.

Accuracy combines both precision and lack of bias, and is measured by the square root of the mean squared error RMSE
RMSE((θ-hat) = [(θ-hat – θ) / θ] ^2

Where the true value (θ) is known, bias and accuracy may be computed for each replicate simulation. The statistic reported is the mean over replicates.


Simulation – Test random generator

Output a sample of values generated with the current pseudorandom number stream in Density.
The distributions currently available are Uniform, Normal, Lognormal, Beta and Poisson. The maximum allowed number of values is 100000. Elapsed time is displayed on completion.

See also: Options | General | Random number generator


Simulation Tools

Simulation | Tools

Clear trap location list
Trap builder
Test random generator
Preview

Clear trap location list

Empty the Trap location box in Trapping and Estimation

Test random generator

Output a sample of values generated with the current pseudorandom number stream in Density. The distributions currently available are Uniform, Normal, Lognormal, Beta and Poisson. The maximum allowed number of values is 100000. Elapsed time is displayed on completion.

See also: Options | General | Random number generator

Preview

Use Preview to view the header part of the simulation output file before you start a long series of simulations. This is a painless way to check that the settings are what you intended.


Simulation – Trap layouts

Spatial simulations require one or more trap layout files. Select and add them to the list box using the button to the right. These files have the same format as for analyses on the main form.

Trap layout files are automatically assigned a letter code (A, B, C, ...) in the sequence they appear in the list box. The code is used to identify the selected layout file in the 'Trapping and estimation stack' (it is included automatically when you click 'Add'). The code '0' (zero) is used to indicate that a trap layout should be selected from the list at random for each replicate.

Each simulation uses a single trap layout (i.e., the facility on the main form for using a different trap layout file in each session of a multi-session analysis has not been emulated in Power Analysis).

Warning: Do not change the trap layout list box between adding lines to the stack and running a simulation. Otherwise, there is a risk of the letter code(s) in the stack becoming invalid (if filenames are removed from the box) or referring to a file other than the one intended.


Advanced

Trapping and estimation | Advanced

Trapping and Estimation Advanced

No further information


Vary Traps

Trapping and estimation | Vary traps

Trapping and Estimation vary traps

No further information


Simulation trend

Simulation - population process and trend

Open-population simulations ordinarily model turnover (births and deaths) directly; in this case, populations in sessions after the first are dependent on the initial population, and we expect serial correlation in population size. Trend in such populations may be evaluated with open-population capture-recapture models, such as those with a population growth rate parameter λ (Nichols and Hines 2002). See 'Simulation | Simulated population | Turnover' and 'Options | Open population'

Population estimates or indices from a sequence of times (years) may also be used in ordinary regression analyses to assess trend. To simulate such data we generate populations independently to provide a realisation of a known trend (this is the 'Trend' option in Options | Simulation). The underlying trend may be a steady linear or loglinear increase or decrease across sessions. The initial population is defined on the Simulation screen. Trend is imposed on population size for a nonspatial model, or on population density for a spatial model. Lognormal process variance about the trend maybe be specified via the coefficient of variation of the time-specific values.

One response variable is selected, and the trend in the response variable is estimated by ordinary least-squares regression. The slope of the linear trend is reported in the field 'Trend' with standard error 'seTrend'. An optional transformation is applied before the linear trend model is fitted. Power* is reported for two one-sided tests, one that the measured trend is greater than zero (increasing) and one that the trend is less than zero (decreasing). These are reported respectively in the fields TRGT0 and TRLT0. The test uses critical values of the t-statistic obtained from R. α is derived from Options | Output. Power depends upon the effect size (the underlying trend; see previous paragraph).

Trend statistics are calculated cumulatively (i.e. the trend for session 5 is calculated from the data for sessions 1, 2, 3, 4 & 5). This is useful for reviewing the effect of increasing study duration on power.

TIP: To perform these simulations you first need to tick Analyses 'Open population' on the right of the Simulation screen, and select a number of sessions (see the spinedit, also in the Trapping and Estimation panel).

WARNING: The true trend and the fitted trend are usually not on the same scale when a transformation is selected, so statistics such as bias RB and RMSE will not be meaningful.

* Power defined as the proportion of replicates in which a trend is detected, given that it exists.

References


Simulation in DENSITY

Simulation in DENSITY Simulation toolbutton

Simulation* is used to determine the expected precision and bias of estimates with a given design. Reporting mostly stops short of calculating 'power' in the strict sense (probability of rejecting the null hypothesis when it is false).

Simulation is repeated a large number of times to obtain the mean and distribution of the estimates. Each replicate includes three steps:

  1. Generate a realisation from a random population model with known parameters
  2. Sample from that population using the desired trap layout etc.
  3. Obtain summary statistics and parameter estimates from the population sample.
DENSITY reports both detail lines (results from a single replicate) and summary statistics (mean, median etc.) for selected fields (estimated population density etc.).

* called 'power analysis' in older versions

See also :
Structure
Quick start
Simulated Population
Trapping and Estimation
Simulation Control and Reporting
Tools
Terminology


Status bar

The status bar at the bottom of the main screen records:

  • Name of open project file, if any
  • Map limits (minimum and maximum of X- and Y-coordinates)
  • X-Y coordinates of cursor position (snaps to nearest trap if there is one close by)
  • Number and type of traps
  • Area of convex polygon formed by the outermost trap (see ETA density for area including boundary strip)
  • Mean distance from each trap to the nearest other trap
  • Pxy at cursor, given current g(0) and σ (from IP SECR Initial values)
  • Length of the edge of the convex polygon formed by the outermost traps.


Autocorrelation test statistic

Autocorrelation test statistic t2/r2

Serial correlation of sampled locations violates many models used for analyzing locational data. It is simply easier to assume that successive locations are sampled independently from a stationary 2-D distribution (the home range utilisation distribution), than to model the serial correlation.

We do not attempt to fit serially correlated movement models in Density (although there is provision for simulating data from a random walk detection process). It is therefore necessary to remain alert to breaches of the independence assumption.

Two statistics may indicate deviation from the model. One is the proportion of recaptures in the same trap as the last (Pzero). The other, described here, is a modification of Schoener's ratio t2/r2 which was popularised for the analysis of independence in animal radiotelemetry locations by Swihart & Slade (1985).

The idea is to compare the squared distances between successive locations, t2, and the squared distances between locations and the range centre, r2. The asymptotic value of this ratio is about 2.0 when locations are independent, and values << 2.0 indicate serial correlation. As there will usually be few recaptures per animal, we pool the data across animals within a trapping session:

,

where [image] is the arithmetic mean location of individual i.

Note that t2 and r2 are closely related to d-bar and RPSV respectively, and it is obvious why RPSV should be less sensitive to serial correlation.

To assess the significance of a particular ratio t2/r2 we use Monte Carlo simulation to generate a large sample of values from the model when the assumption of independence holds (Manly 1997).

References


Tab delimited

Output values are usually separated by blanks to give a tidy tabular look. Alternatively, values may be separated by a single tab character. This makes it easy to cut and paste data from the output table into a spreadsheet such as Excel.

See Options | Output


Animals tool button

Use this button to visualise a population of animals distributed at some arbitrary density. Small simulated trapping experiments may also be conducted 'on the fly'.
Generally it is enough just to click the tool button and select Auto in the 'Demonstration parameters' box. A new population will be simulated and displayed each time you double-click Animals. The current number of simulated animals appears on the status bar at the bottom of the main form. This varies: the number follows a Poisson distribution.

More options are provided on a popup menu:
Set demo parameters | Displays the Demonstration parameters box if it is not already visible
Copy to clipboard | Copies an image of the map
Show density grid | Displays a square grid ; cell area 1/density
Show detection radius | Displays a circle around each animal; radius a multiple of the spatial scale parameter sigma
Set detection radius | Adjust the sigma multiplier
Freeze population | Retain the current or first simulated population
Start capture file | Name a file to receive simulated detections
Simulate one sample | Execute the trapping algorithm with current population and parametersResults will be displayed on the map with lines drawn between animal locations and traps. Data are saved in TrapID format in the preceding file, if specified.

To conduct a trapping experiment we suggest these steps:
  1. Freeze the population (popup menu)
  2. Specify an output file (popup menu)
  3. Click 'Simulate one sample' (leaves this popup menu option ticked)
  4. Double-click the Animals tool button for as many additional samples as you like
  5. Select your output file in the Capture Data box and click Read Data
The simulated data may then be analysed as usual. For serious simulation, use The Simulator.

TIP: Detections appear in yellow which is difficult to see on the default white background. For a more graphic display, change the background to black [right-click the map; select 'Graphic options' in the popup menu; click on the Drawing colours Background colour tile, select black, OK, Exit]

TIP: The 'Animals' button is for display only and plays no part in estimation


Test data sets for DENSITY 5

Test data sets

[Additional notes at end]
Study | Data type | Files | Notes | References
Simulated data: 10 x 10 grid, 5 occasions 235 captures of 76 animals. | XY capture format, closed-population. Detector type: single-catch trap | trap.txt capt.txt | The original test data set distributed with Density 2.1 | None
Brushtail possum Trichosurus vulpecula in the Orongorongo Valley 1996–1997. Six trapping sessions, (each 5 days at 167 traps) from a long-term study. | XY capture format, robust design, habitat mask. Detector type: single-catch trap | ovtrap.txt ov4954.txt ovmask.txt ovimage.jpg | See possum example | Efford & Cowan 2005
Ferrets on farmland in central Otago, New Zealand. Trapping with 131 traps for 6 days over about 12 km2 resulted in 214 captures of 73 ferrets. | TrapID capture format, closed population. Detector type: single-catch trap | Bend H1 LCR gps.txt Bend H1 LCR capt.txt | See ferret example | Norbury & Efford 2004 unpubl.
Live capture and release of desert rodents on trapping webs surrounded by a rodent-proof fence, used to validate distance analyses. | TrapID capture format, multiple closed populations. Detector type: single-catch trap | websites.txt webcapt.txt removalgrid.txt | See trapping web example | Parmenter et al. 2003
Mist netting of breeding forest birds2 by C. S. Robbins for 6 days annually on a grid of 44 sites at Patuxent Wildlife Research Center, Maryland USA 1961–1972 | TrapID capture format, robust design. Detector type: multiple-catch trap | netsites6172.txt breeding6172top10.txt | A large multi-species dataset; only the ten most common breeding species are included (below). The species code is appended to each capture record, and can be used to filter for single species. | Stamm et al. 1960 Noon & Sauer 19903 Efford et al. 2004 Borchers & Efford 2008
Stoat Mustela erminea identified from DNA microsatellites in hair samples from grid of sticky tubes in forest, Matakitaki Valley, New Zealand. | TrapID capture format. Closed population. Detector type: proximity detector | matakitraps.txt matakicaptures.txt | Data of Andrea Byrom and others | Efford, Borchers & Byrom in press
Meadow voles Microtus pennsylvanicus in old field at Patuxent Wildlife Research Center, Maryland USA. 1981. | Non-spatial, open-population | jlyexmplc.txt | Converted from test data for Program Jolly to a DENSITY input capture file with 'Tools | Import capture histories'. This version of the data does not include within-session recaptures. | Nichols et al. 1984. Pollock et al. 1990 p29. Williams et al. 2002 p. 436
Snowshoe hare Lepus americanus live-trapped on a 10 x 10 grid near Fairbanks, Alaska. 1972. | Non-spatial, closed-population | snowshoe.txt | Data of Burnham & Cushwa used to benchmark Mh estimators. This version adapted from Dorazio & Royle 2003. | Otis et al. 1978 p36. Dorazio & Royle 2003

Notes
1. Losses on capture probably occurred in all studies, but they are only recorded explicitly for the meadow vole study. Parmenter et al. (2003) noted their study was almost free of trap losses except for two animals whose records were eliminated.
2. Species in C. S. Robbins mist netting dataset:
Code | Species
REVI | Red-eyed vireo | Vireo olivaceus
WOTH | Wood thrush | Hylocichla mustelina
OVEN | Ovenbird | Seiurus aurocapillus
KEWA | Kentucky warbler | Oporornis formosus
ACFL | Acadian flycatcher | Empidonax virescens
ETTI | Eastern tufted titmouse | Baeolophus bicolor
HOWA | Hooded warbler | Wilsonia citrina
NOCA | Northern cardinal | Cardinalis cardinalis
AMRE | American redstart | Setophaga ruticilla
SCTA | Scarlet tanager | Piranga olivacea

3. The results for survival of adult REVI and WOTH reported by Noon & Sauer include data from 1959 and 1960 that are not included here because the net array differed (Stamm et al. 1960).

References


Tool buttons

Main form tool buttons

Options | Open the Options window
Read data | Read trap layout and capture files and summarise data from the first session
Simulation | Open the module for simulating spatial samples from populations with known parameters more
Trap builder | Open the Trap Builder module to design a trap layout and save it to a file more.
R interface | Open a form to select and edit R commands and view output
Captures | Map the daily captures in the current trapping session. Captures on successive days of a session are arranged clockwise around the trap site starting at about 5 o'clock at angular intervals of 2π/k where k is the number of secondary sessions in the current primary session. Right-click on the map for display options
Animals | Visualise a population of animals distributed randomly across the available habitat at the density in the 'Demonstration parameters' box. The 'Animals' button is for display only and plays no part in estimation. more
Pxy contours | Visualise spatial variation in a measure of individual capture probability more
GO | Execute selected analyses for current session only
GO ALL | Execute selected analyses for each of the remaining primary sessions, starting with the session currently displayed
View log | Display the log file in text window; text may be selected and copied. Any changes are lost unless the file is saved explicitly
View output | Display the output file in text window; text may be selected and copied. Any changes are lost unless the file is saved explicitly
Help | Open the HTML help system
Reset | Blank the display and return to the start


Tools menu

Export | Animal locations | Save the range centres simulated by pressing the Animals toolbutton
 | Pxy values | Save Pxy values. Values are computed at the vertices of a grid across the currently displayed trap map. Grid dimensions are set in Options | Graphics | Contour settings. See also Pxy contours.
 | Pxy vs area | Save the values used for the Pxy vs area line plot.
 | ETA perimeter | Save coordinates of effective trapping area boundary as displayed with ETA density | Show
 | Clipped mask | Save coordinates of the current mask clipped to the current buffer width.
 | Coordinates of mesh | Save the coordinates of the points on the current integration mesh, including only those within the active habitat mask.
Transfer to Simulation Ctrl+T |  | Open a Simulation simulation session with settings that mimic the current analysis as closely as possible.
IP SECR confidence ellipse |  | Plot prediction ellipse for a pair of parameters just estimated by inverse prediction.
ML SECR log likelihood |  | Open a form to calculate the likelihood of an SECR model at nominated parameter values. Also used to check settings such as the integration buffer width or coarseness of the integration grid. more
ML SECR plot profile LL |  | Compute and plot the profile log likelihood for a range of densities
ML SECR contour P(x,y | wi) |  | Overlay contours for a selected individual on the map of the main form. First click the Captures button to display captures, and turn on 'Select by animal'. The detection model is specified on Options | ML SECR.
ML SECR confidence ellipse |  | Plot confidence ellipse for a pair of parameters just estimated by ML SECR. The ellipse is computed on the link scale for each parameter and back-transformed to the original scales. This can have interesting consequences.
Append to output | Legend | Annotate the current output file with a legend describing the output columns
 | New header | Add a complete and up-to-date header to the current output file
 | Header line | Add a column header line to the current output file.
Append to log | Distance commands | Place commands for current Distance analysis in log file for future reference
 | IP SECR ellipse | Report equation of the relevant confidence ellipse and list the coordinates of points on the ellipse
 | ML SECR ellipse

References


Toroidal wrapping

Spatial point patterns are usually observed or simulated within a limited region, even when they are known or assumed to extend beyond that region. The resulting edge effects will bias some analyses and distort some graphical summaries. This applies in DENSITY when
  • The density surface matching a simulated distribution of animals is contoured in the Simulator
  • The 'proportion of area occupied' is estimated by summing usage across animals whose range centres have been simulated.
A satisfactory correction is often achieved by 'toroidal wrapping' - essentially using the opposite edge of the observed (simulated) pattern to stand in for the unobserved pattern beyond the boundary. This is a standard method in geographical analysis (e.g. Yamada and Rogerson 2003).

Switch toroidal wrapping on or off in Options | Computation. There is a modest computational cost. This is reduced by limiting the 'visibility' of the wrapping algorithm to points within an outer buffer, expressed as a multiple of sigma for the current home range model (noting that within DENSITY wrapping is performed only in the context of home range analyses).

WARNING: Wrapping is misleading when there is a gradient in density across the area ('Poisson X-gradient') or the actual habitat does not extend beyond the buffered area. It is of limited value when a habitat mask is used.

References


Transformations

Odds

odds (p) = p / (1–p) p ≠ 1
odds –1(x) = x / (x+1) x ≠ –1

Log

In DENSITY this always refers to the natural logarithm. log(x) is defined for x > 0
log –1(x) = exp(x)

Logit

A logit-transformed probability (range 0–1) lies in the range –Infinity to +Infinity. Conversely, any real number when logit back-transformed is a feasible probability value. This makes the logit transformation useful for manipulating capture probabilities and per capita vital rates (e.g. survival probability).

logit (p) = log(p / (1 – p)) 0 < p < 1
logit –1(x) = 1 / (1+exp(–x))

The logit transformation is also called 'logistic' or 'log odds'.


Trap layout box

Trap layout

File name(s)

Provide the name of a text file containing the X-Y coordinates of the sites at which traps were set.

See Trap file format. Trap data may be from a single file or multiple files. A single file is the default. The user must explicitly enable multiple files by ticking Options | Input | Allow multiple trap files.

If more than one file is given, then the first will be used for the first trapping session, the second for the second session etc. If the number of sessions exceeds the number of trap files then the last file is re-used. Scroll buttons appear at the right of the box if you have added more than one name. If in doubt, right-click on a file name for the chance to clear the list and start again. You can also right-click and select 'Edit list' to open the list of file names in a text window, and it is a good idea to use this to check long lists.

TIP: Capture data are sorted automatically by session when they are loaded. The order of sessions is alphanumeric: 'April' comes before 'February', and '10' comes before '2'. You can get sessions in the order you want by adding a prefix e.g. '02.Feb', '04.Apr', '07.Jul', '10.Oct'.

Detector type

By default, each trap (we use the words 'trap' and 'detector' interchangeably) is assumed to catch a maximum of one animal, and animals are released alive. The 'Detector type' dropdown box changes this default (options: Single live, Multi live, Proximity, Single kill, Multi kill). The new type is applied to all traps in every sampling session. Alternatively, more elaborate combinations may be specified in the trap file, in which case the trap-type dropdown option 'From file' should be selected.
Warning : Only 'Single live', 'Multi live' and 'Proximity trap types are generally useful for estimating density by IP SECR and ML SECR, and for the latter a 'Multi live' model is used to approximate 'Single live' data.

Buffer width

Simulations use a rectangular 'arena' that includes all the trap sites plus a buffer extending a fixed number of metres north, east, south and west of the outermost sites. For inverse prediction, buffer width should be several times σ, the spatial scale parameter of the detection function. For a circular bivariate normal distribution, 95% of probability lies within 2.45 σ. A large buffer is wasteful because it requires the simulator in IP SECR) to deal with many animals that are unlikely to ever get caught.

The buffer width serves to define the area of integration for likelihood-based estimates, and the criteria for a good buffer are similar to those for inverse prediction. Too small a buffer causes positive bias in density (more distant areas are implicitly classed as 'nonhabitat'). A buffer that is much too large may lead to imprecision in the evaluation of the likelihood and erratic variation in the estimates.

Tip: Use Tools | Preview trap layout or double-click within the box to preview a trap layout

See also Preview trap layout


Trap covariates

A trap covariate is a numeric* value used to model detection at a particular trap site (g0 or σ or both). Trap covariates are used only in ML SECR.

Trap covariates are input by appending '/' and one or more values to each input line in the trap layout file. When specifying a within-session SECR model you may choose which of several potential covariates to include in the model using the relevant filter in Options | ML SECR (the 'filter' is the column number, 1 for covariate column 1, 2 for column 2 etc.). For example, the following file has one covariate field (the values 1.5, 0.5 etc):

# This is a demonstration trap file for program DENSITY
1     365     365  / 1.5
2     365     395  / 1.5
3     365     425  / 0.5
4     365     455  / 0.5
...

* From DENSITY 5.0 one character-valued field is permissable; values will be assigned to numeric codes (0, 1, ...) with 0 being used for the first encountered value. This is probably useful only for a two-level character code. e.g. two different detector types.


TSProc2 source code

Pascal code for trapping simulation

This is old code implements the algorithm in Efford (2004) Oikos 106:598-610 Appendix., with some extensions.

unit tsproc2;

// DENSITY
Version 2.1
// Distributed under GNU
General Public License Version 2

// Code for trap catch simulation using time-to-next-event algorithm
// This is the form of the algorithm used in the Density Simulator
// It includes complications missing from the one used for IP SECR
//   - possible bimodality of spatial detection
function
//   - possible escape from trap
//   - possible learned trap response (g0
<> g0recapture)
// Code has been edited in html for legibility

// Trapsim2 is passed the trap coordinates ('traps') and a pointer
to
// a list of animals with their home-range locations and individual
// capture probability parameters ('animal_list').
// It updates a pointer to a list of capture events ('capts') with the
record
// structure 'inputrecord'. 'Capts' is used by downstream routines to
calculate
// mark-recapture statistics etc.

// These global constants and types are assumed

// CONST
// maxtraps   = 1000;
// maxanimals = 10000;
// maxntimes  = 100;
// TYPE
// inputrecord = record
//   Session   : string[8]; // session identifier
//   alphaID   : string[8]; // animal identifier
//   Time      : integer;   // sample within session
//   trapid    : string[8];
//   trapindex : integer;
//   x,y       : integer;
//   notes     : string[30];
//   Released  : boolean;
// end;
// inputarray = array[1..maxrecords] of inputrecord;
// inputptr   = ^inputarray;
// tdetector =(notset, singlecatchlive, multicatchlive,
//             proximity, singlecatchkill, multicatchkill);
// trapdetail = record
//   x : integer;
//   y : integer;
//   detector : array [1..maxntimes] of tdetector;
// end;

INTERFACE

uses
  contnrs, sysutils,   // Delphi units
  globals;             // DENSITY unit with above declarations

const
  huge = 1e10;
  tol  = 1e-4; // ignore biomodality when p2 is less than tol

type

animal2 = record
  ID      : integer;
  x       : real;
  y       : real;
  x2      : real;    // centre of second mode
  y2      : real;    // centre of second mode
  group   : integer;
  SD      : real;    // sigma of half normal detectability function
  g0      : real;    // capture probability when trap and animal range centre coincide
  g0recap : real;    // g0 after first experience
  escapep : real;    // probability that the animal escapes when caught
  mode2   : real;    // probability that observation is at second mode
  alive   : boolean; // runtime accounting
  caught  : boolean; // runtime accounting
end;

trap_animal = record
  time    : real;
  animali : integer;
  trapj   : integer;
end;

animalarray2  = array[1..maxanimals] of animal2;
tr_an_array   = array[1..maxanimals * maxtraps] of trap_animal;
IDarray       = array[1..maxtraps] of integer;
taptr         = ^tr_an_array;
aptr          = ^animalarray2;

Procedure ProbSort (n: integer; tran:taptr);

Procedure trapsim2 (
  nanimals    : integer;   // number of individuals
  ntraps      : integer;   // number of traps
  traps       : traparray; // x,y coordinates of trap locations
  maxtime     : real;      // duration of trapping; usually 1 unit
  truncate    : real;      // capt prob set to zero beyond this threshold
  model       : detection_model;
  var animal_list : aptr;
  var capts   : inputptr;  // see Globals
  var ncapt   : integer;   // number of detections
  t           : integer;   // sample time within session (1..ntimes)
  dtypevaries : boolean
);

{==============================================================================}

IMPLEMENTATION

{==============================================================================}

Procedure ProbSort (n: integer; tran:taptr);
{ Sort using Shell algorithm see Press et al 1989 p 257 }
{ tran is a pointer to an array of trap_animal records }

Label 1;

Const
  aln2i = 1.442695022;
  tiny  = 1.0e-5;
Var
  nn,m,
  lognb2,
  l,k,j,i    : integer;
  t          : trap_animal;
  outoforder : boolean;
Begin
  lognb2 := trunc(ln(n)*aln2i+tiny);
  m      := n;
  for nn := 1 to lognb2 do
    begin
    m := m div 2;
    k := n-m;
    for j := 1 to k do
        begin
      i := j;
   1: l := i+m;
      outoforder := tran^[l].time < tran^[i].time;
      if outoforder
        then begin
        t        := tran^[i];
        tran^[i] := tran^[l];
        tran^[l] := t;
        i        := i-m;
        if i >= 1 then goto 1
      end
    end
  end
end; { Of ProbSort }
{===============================================================================}

{===============================================================================}
function gr (
  granimal : animal2;
  grtrap   : trapdetail;
  model    : detection_model;
  truncate : real
): real;

{ returns naive probability g(r) that given animal will be caught in given trap }

var d2, d12, d22: real;

begin
  with granimal do
  begin
    if mode2<tol  // simple case that this animal has one mode
    then begin
      d2 := sqr(grtrap.x-x) + sqr(grtrap.y-y);
      case model of
      halfnormal : result := g0 * exp(-(d2) / 2 / sqr(SD));
      truncatednormal : if sqrt(d2)>(truncate*SD)
                        then result := 0
                        else result := g0 * exp(-(d2) / 2 / sqr(SD));
      uniform : if d2<=sqr(SD) then result := g0 else result := 0
      end; { of case }
    end
    else // more complex case of two modes
    begin
      d12 := sqr(grtrap.x-x) + sqr(grtrap.y-y);
      d22 := sqr(grtrap.x-x2) + sqr(grtrap.y-y2);
      case model of
      halfnormal :
        begin
          result := g0 * ((1-mode2)* exp(-(d12) / 2 / sqr(SD)) +
                    mode2 * exp(-(d22) / 2 / sqr(SD)));
        end;
      truncatednormal :
        begin
          if sqrt(d12)>(truncate*SD) then d12 := huge;
          if sqrt(d22)>(truncate*SD) then d22 := huge;
          result := g0 * ((1-mode2)* exp(-(d12) / 2 / sqr(SD)) +
          mode2 * exp(-(d22) / 2 / sqr(SD)));
        end;
      uniform :
        begin
          if d12<=sqr(SD) then result := (1-mode2) * g0 else result := 0;
          if d22<=sqr(SD) then result := result + mode2 * g0;
        end;
      end; { of case }
    end;
  end;
end; { of function gr }
{================================================================================}

procedure trapsim2;
var
  tr_an      : taptr; // pointer to array of trap_animal;
  tr_an_indx : integer;
  nextcombo  : integer;
  finished   : boolean;
  OK         : boolean;
  i,j        : integer;
  anum, tnum : integer;
  p          : real;
  event_time : real;
  trapped    : array [1..maxtraps] of boolean;
  dnum       : integer; // detector index
                  // either dnum=t (detector array loaded with separate
                  // type for each time) or dnum=1 (always use initial)

{========================================================}
Function randomtime (p: real): real;
// returns a pseudorandom number representing the time to next event
// of a Poisson process given probability P that an event occurs in unit time
Const
  minprob = 1e-4;
Var
  lambda   : real;
  random_U : real;
Begin
  if (p < minprob)
  then result := huge // ignore trivial p
  else if (p >= 1.0)
  then result := -random // trick to spread P=1
  else begin
    lambda   := -ln(1-p); // rate parameter
    random_U := random;
    if random_U <= 0 // trap for zero
    then result := huge
    else result := -ln(random_U)/lambda;
    // random exponential e.g. Ripley 1987 Algorithm 3.2 p 55
  end;
End;
{========================================================}

begin
// maxtime controls the duration of the experiment
// if maxtime = Inf then the experiment proceeds
// until all animals caught or all traps full
// M Efford 16/03/01 - 1/4/03

{========================================================}
{ Initialise for this trapping day }
{========================================================}

  for i := 1 to ntraps do trapped[i] := false;
  if dtypevaries
  then dnum := t
  else dnum := 1;

  for j := 1 to nanimals do animal_list^[j].caught := false;
  getmem (tr_an, nanimals * ntraps *sizeof(trap_animal));
{========================================================}

try
{===================================================================}
{ Prepare a 1-D array of random times to first capture for each p,t }
{ Assume that randomize has been called or randseed set manually }
{===================================================================}
  tr_an_indx := 0;
  for i := 1 to nanimals do
    if animal_list^[i].alive and not animal_list^[i].caught then
    for j := 1 to ntraps do
    begin
      p          := gr(animal_list^[i], traps[j], model, truncate);
      event_time := randomtime(p);
      if event_time <= maxtime
      then
      begin
        inc(tr_an_indx);
        tr_an^[tr_an_indx].time    := event_time;
        tr_an^[tr_an_indx].animali := i;
        tr_an^[tr_an_indx].trapj   := j;
      end;
    end;
  {================================================================}

  {================================================================}
  { Sort the probabilities for animal-trap combinations into order }
  if (tr_an_indx>0) then probsort (tr_an_indx, tr_an);
  {================================================================}

  {================================================================}
  { Process captures until time expires }
  {================================================================}

  nextcombo := 0;
  while ((nextcombo < tr_an_indx) and (nanimals>0) and (ntraps>0)) do
  begin

    {==============================================================}
    { get next available trap_animal combination }
    {==============================================================}

    finished := false;
    repeat
      if nextcombo >= tr_an_indx
      then finished := true
      else begin
        inc(nextcombo);
        anum := tr_an^[nextcombo].animali;
        tnum := tr_an^[nextcombo].trapj;
        case traps[tnum].detector[dnum] of // 8/11/02
          notset          : OK := false;
          singlecatchlive : OK := (not trapped[tnum]) and not animal_list[anum].caught;
          singlecatchkill : OK := (not trapped[tnum]) and not animal_list[anum].caught;
          multicatchlive  : OK := not animal_list[anum].caught;
          multicatchkill  : OK := not animal_list[anum].caught;
          proximity       : OK := true;
        end; { of case }
      end;
    until finished or OK;

    {============================================================}

    if not finished then
    {============================================================}
    { record capture }
    {============================================================}
    if random >= animal_list^[anum].escapep then
    begin
      // Replace g0 with recapture g0
      with animal_list^[anum] do g0 := g0recap;
      // Record this capture
      if not finished
      then begin
        trapped[tnum] := true;
        ncapt         := ncapt+1;
        with capts^[ncapt] do
        begin
          alphaID := inttostr(anum); // is this needed in sims?
          time    := t;
          x       := traps[tnum].x;
          y       := traps[tnum].y;
        end;
        animal_list[anum].caught := true;

        case traps[tnum].detector[dnum] of
          notset : ;
          singlecatchlive :
          begin
            nanimals                 := nanimals-1;
            ntraps                   := ntraps-1;
            capts^[ncapt].Released   := true;
          end;
          singlecatchkill :
          begin
            nanimals                 := nanimals-1;
            ntraps                   := ntraps-1;
            capts^[ncapt].Released   := false;
            animal_list^[anum].alive := false;
          end;
          proximity :
          begin // all animals and traps remain available
            capts^[ncapt].Released   := true;
          end;
          multicatchlive :
          begin
            nanimals                 := nanimals-1;
            capts^[ncapt].Released   := true;
          end;
          multicatchkill :
          begin
            nanimals                 := nanimals-1;
            capts^[ncapt].Released   := false;
            animal_list^[anum].alive := false;
          end;
        end;  { of case }
      end
    else
    begin
      // animal escapes but trap sprung; animal may be caught elsewhere
      if traps[tnum].detector[dnum] in [singlecatchlive, singlecatchkill]
      then begin
        trapped[tnum] := true;
        ntraps        := ntraps-1;
      end;
    end;
  end;
  {============================================================}

  end; { of while loop }
  {================================================================}

finally
  freemem(tr_an);
end;

end;  { of Trapsim2 }
{===================================================================}

end.


Units of area

Choose between hectares and square km (100 ha = 1 km2).

Units affect only the presentation of results: all calculations are done in metres.

Side effect: Grid lines switch between 100m and 1 km default spacing.


Incomplete trap layouts

It is usually assumed that all detectors in a trap layout were operated on all occasions. This can be overridden for SECR by providing a string of single-digit codes after the trap coordinates in the trap layout file, one code for each occasion, and ticking the 'Incomplete trap layout' box in Options | Input . Detectors that were not used on a particular occasion are indicated with a zero. For example,

1 365 365 11111
2 365 395 11111
3 365 425 00111
etc.

[Detector 3 not set on first 2 occasions]

The number of codes must exactly match the number of occasions in the data. Codes may also be separated by spaces or commas.

For ML SECR, detector type is determined solely by the trap layout type on the main form ('Multi live' or 'Proximity'), and this applies to all detectors in use.

TIP: Non-zero codes may also be used to distinguish different detector types, but these distinctions apply only when the data are used for IP SECR and the trap layout type has been designated 'Abstract'.

TIP: Review which traps are in operation by right-clicking on the trap map and selecting 'Show detector usage' from the popup menu.


Verify before execution

This functions as a sort of safety catch for large and complicated analyses. With the option selected, after 'GO' or 'GO all' DENSITY will display a preliminary report of the requested analyses and wait for confirmation before proceeding. (Frustrating if you hit 'GO' and head off for a coffee expecting the job to be done when you return!).

DENSITY requires fresh confirmation for each 'session'


View menu

Traps | Open trap layout file
Captures | Open capture data file
Output | Open output file
Log | Open log file
Capture histories | Create and view a temporary text file of capture histories
Other text file | Open any text file

Pictures | Enable the Picture Viewer to display images from the list of files in Options | Graphics. Pictures appear on the main form; right-click on a picture for display options.
Toggle map size | [Another method is to double-click outside right border of the map]
Map popup menu | [Another method is to right-click on the map]
Preview trap layout | See Preview trap file


Windows priority class

'Below normal' allows other processes to proceed freely while DENSITY works on a long task.

Settings above normal should be avoided.

The 'Sleep' button in Power Analysis switches DENSITY into the 'Below normal' priority class and minimizes the form.

This option has no effect in Windows 95, but works in Windows 2000.


Working directory

Default folder for input data and output files.