Activity patterns of the small and medium felid ( Mammalia : Carnivora : Felidae ) guild in northeastern India

Fifteen extant species of cats inhabit India, and the northeastern region of the country is among the richest with nine species. Among these are the “standard four”, an assemblage of Clouded Leopard Neofelis nebulosa, Asiatic Golden Cat Catopuma temminckii, Marbled Cat Pardofelis marmorata, and Leopard Cat Prionailurus bengalensis, which also occur across southeastern Asia. Within India, despite several surveys in this region, very little information exists on the ecology of this assemblage to explain their co-occurrence. In this paper, we put together data from several independent camera trapping studies over 10 sites across northeastern India to examine and interpret diel activity patterns of this group. While we present results for all the four species, we focus on two species, the Marbled Cat and Leopard Cat, which are of very similar body size and are potential competitors. We used kernel density estimates to measure diel activity patterns of all four species and overlap in activity between Marbled Cat and Leopard Cat at the regional scale as well as the point scale. We obtained 783 captures of the standard four from >27,500 trap nights. The Asiatic Golden Cat and Marbled Cat were strongly diurnal, Clouded Leopard largely crepuscular and nocturnal, and Leopard Cat largely nocturnal. The degree of overlap between Marbled Cat and Leopard Cat activity was low and in consensus with other studies across southeastern Asia. We interpret this as the differing niche spaces of the two cats due to their specific pre-existing adaptations, not restricted to the effects of competition. The point scale analysis when both cats are captured at the same location and separately show no shift in activity pattern, supporting our hypothesis of pre-existing differences in resources, such as food, playing a major role in facilitating co-existence. Our study, however, is preliminary and additional information with robust analysis is required to test this finding.

The times recorded on camera trap photos provide information on the period during the day that a species is most active. Species active at the same periods may interact as predator and prey, or as competitors. The functions in this package allow the overlap to be quantified, and provide means of estimating confidence intervals with bootstraps.

Details
The functions in this package were originally optimised for a simulation study. Hence, speed is important and checking of input is minimal. It is the user's responsibility to make sure that input is valid.
In particular, note that all times are measured in radians. If your original data use 0-24 hours or 0-1 days, convert to radians: see the example in kerinci. If you need fitted densities in other units, use the output from densityPlot or overlapPlot.

Author(s)
Mike Meredith, based on work by Martin Ridout.

References
Ridout & Linkie (2009) Estimating overlap of daily activity patterns from camera trap data. Journal of Agricultural, Biological, and Environmental Statistics 14:322-337

See Also
See overlapTrue for the definition of the coefficient of overlapping, and overlapEst for equations for the estimators. See kerinci for an example of calculation of overlap and confidence interval from real data.
The R package activity has more functions for analysis of animal activity patterns.

Details
Let t = true value of the statistic, t0 = estimate of t based on the original sample, bt = bootstrap estimates.
Assuming that the original sampling causes the same bias as the bootstrap sampling, we write: mean(bt) -t0 = t0 -t, and hence calculate a bias-corrected estimate, t1 = 2 x t0 -mean(bt).
The percentiles CI, "perc", gives quantiles of the bootstrap values, interpolated if necessary. However, in general, the bootstrap estimates are biased, so "perc" should be corrected.
"norm" gives tail cutoffs for a normal distribution with mean = t1 and sd = sd(bt).
These three are equivalent to the confidence intervals returned by boot::boot.ci. "basic" and "norm" are appropriate if you are using the bias-corrected estimator, t1. If you use the uncorrected estimator, t0, you should use "basic0" or "norm0": "basic0" is perc -mean(bt) + t0.
"norm0" gives tail cutoffs as before, but with mean = t0 instead of t1.
The "logit" versions perform the corrections on the logit scale and then back transform. This would be appropriate for probabilities or proportions.

Value
A named matrix with 2 columns for lower and upper limits and a row for each type of estimate. Values will be NA if the bootstrap sample is too small (after removing NAs) for estimation: 40 is the minimum for a 95% confidence interval, 200 for 99% (though for stable estimates you need at least 999 bootstrap estimates, preferably 10,000).

Mike Meredith
See Also boot.ci in package boot. See kerinci for an example. (2) pass these matrices to bootEst to obtain the bootstrap estimates.
A vector of bootstrap estimates can then be used to produce confidence intervals with bootCI.

Arguments
A, B vectors of times of observations of two different species in radians, ie. scaled to [0, 2π]. kmax maximum value of k for optimal bandwidth estimation.
n.grid number of points at which to estimate density for comparison between species; smaller values give lower precision but run faster in bootstraps.
type the name of the estimator to use, or "all" to produce all three estimates. See overlapEst for recommendations on which to use.
cores the number of cores to use for parallel processing. If NA, all but one of the available cores will used. Parallel processing may take longer than serial processing if the bootstrap runs quickly.
x a numeric vector of time-of-capture data in radians, ie. on [0, 2π] scale Amat, Bmat matrices of resampled data for each species produced by resample; see Value below.

Value
The function bootstrap returns a vector of bootstrap estimates. If estimation fails for a bootstrap sample, the corresponding value will be NA.
The function resample returns a numeric matrix with each column corresponding to a bootstrap sample. Times are in radians. It may return a matrix of NAs if smooth = TRUE and bandwidth estimation fails.
Function bootEst with type = "all" returns a numeric matrix with three columns, one for each estimator of overlap, otherwise a vector of bootstrap estimates.

Author(s)
Mike Meredith, including code by Martin Ridout.

References
Ridout & Linkie (2009)  Fits a kernel density function to a data set and plots it.

Arguments
A a vector of times of observations in radians, ie. scaled to [0, 2π]. It must include at least 2 unique observations to fit a kernel density. xscale The scale for the x axis: 24 (the default) produces a curve with 0 to 24 hours. NA gives a scale in radians, labelled with pi.
xcenter the center of the plot on the x axis: 'noon' (default) or 'midnight'.
add If TRUE, the curve will be added to the existing plot. Use the same settings for xscale and xcenter as for the original plot.
rug If TRUE, the original observations will be displayed as a rug at the bottom of the plot.

extend
If not NULL, the plot extends 3 hours before and after the main 24-hr period, and extend specifies the background colour; the plot is not extended if extend = NULL.
n.grid Number of points at which to estimate the density for plotting; 100 is usually adequate to give a smooth-looking curve.
kmax maximum value of k for optimal bandwidth estimation.

Value
Returns invisibly a data frame with x and y coordinates which can be used for further plotting or calculations; see examples.

Value
Optimal bandwidth for the sample data, or NA if estimation fails.

Author(s)
Code by Martin Ridout, error handling modified by Mike Meredith.

Description
Calculates up to three estimates of activity pattern overlap based on times of observations for two species.

Details
See overlapTrue for the meaning of coefficient of overlapping, ∆.
These estimators of ∆ use kernel density estimates fitted to the data to approximate the true density functions f(t) and g(t). Schmid & Schmidt (2006) propose five estimators of overlap: Dhat1 is calculated from vectors of densities estimated at T equally-spaced times, t, between 0 and 2π: For circular distributions, Dhat2 is equivalent to Dhat1, and Dhat3 is inapplicable.
Dhat4 and Dhat5 use vectors of densities estimated at the times of the observations of the species, x and y: overlapEst where n, m are the sample sizes and I is the indicator function (1 if the condition is true, 0 otherwise).
Dhat5 simply checks which curve is higher at each point; even tiny changes in the data can result in large, discontinuous changes in Dhat5, and it can take values > 1. Don't use Dhat5.
Comparing curves at times of actual observations works well if there are enough observations of each species. Simulations show that Dhat4 is best when the smallest sample has at least 50 observations. Dhat1 compares curves at n.grid equally spaced points, and is best for small samples.

Value
If type = all, a named vector of three estimates of overlap, otherwise a single estimate. Will be NA if optimal bandwidth estimation failed.

Author(s)
Mike Meredith, based on work by Martin Ridout.

References
Ridout & Linkie (2009)  Fits kernel density functions to two data sets and plots them, shading the area corresponding to the coefficient of overlap.

Arguments
A, B vectors of times of observations for species A and species B in radians, ie. scaled to [0, 2π]. Each must include at least 2 unique observations to fit a kernel density.
xscale the scale for the x axis: 24 (the default) produces a curve with 0 to 24 hours. NA gives a scale in radians, labelled with pi.
xcenter the center of the plot on the x axis: 'noon' (default) or 'midnight'.
linetype a vector of length 2 giving the line type for each species. Look for lty in par for ways to specify this. extend If not NULL, the plot extends 3 hours before and after the main 24-hr period, and extend specifies the background colour; the plot is not extended if extend = NULL.
n.grid number of points at which to estimate the density for plotting; 100 is usually adequate to give a smooth-looking curve.
kmax maximum value of k for optimal bandwidth estimation.
... Further arguments passed to the plotting functions such as main,xlab,ylab,ylim.

Value
Returns invisibly a data frame with columns: x a vector of equally-spaced times from midnight to midnight inclusive on the scale specified by xscale. densA a vector of length x with the fitted kernel density for species A. densB a similar vector for species B.

Mike Meredith
See Also densityPlot for plotting a single density curve.

Description
Calculates the true coefficient of overlapping between two distributions.
Usage overlapTrue(d1, d2 = NULL) Arguments d1 either a vector or a 2-column matrix of densities for equidistant points from 0 to 2π; if densities for both 0 and 2π are included (and are equal), one will be ignored.
d2 a vector of densities as for d1; ignored if d1 is a matrix

Details
The coefficient of overlapping ∆ for two probability density functions f(x) and g(x) is given by: If the two curves in the plot below represent activity patterns of two species, the coefficient of overlapping is the area under the lower of the two curves, shaded grey in the figure:

Value
The coefficient of overlap of the two distributions. The function is intended to calculate true overlap for simulated data. If the densities provided are fitted kernel densities, an estimate of overlap results.

Author(s)
Mike Meredith, based on code by Martin Ridout.

Simulated call data
Simulated data for bird calls influenced by sunrise

Description
A simulated data set of bird calling activity. 80% occur around sunrise with a strong peak just before sunrise, the remainder occur around sunset. Changes in the times of sunrise and sunset through the year mean that both peaks appear to be broader than they should. The hypothetical location is near St Andrews, UK, longitude 3 degrees West, lattitude 56 degrees North (CRS WGS84) and times are GMT throughout (not British Summer Time).

Format
The data set consists of a data frame with two columns: time is a vector of 100 observations of bird calls in radians. Here π/2 corresponds to 6am and 3π/2 to 6pm. The time zone is UTC (GMT).
dates is a character vector of dates in ISO format.

Source
Simulated data.

Examples
## See examples for the function sunTime .

Simulated data
Simulated data for diurnal activity patterns Description tigerObs and pigObs are simulated data sets with times of observation. tigerTrue and pigTrue are densities from which the simulated observations were drawn.

Format
The data set consists of four vectors: tigerObs is a vector of 100 observations of a crepuscular species in radians.
pigObs is a vector of 80 observations of a diurnal species in radians.
tigerTrue and pigTrue are vectors of densities at 128 times equidistant between 0 and 2π inclusive.

Details
The figures below show the true densities (solid line), the simulated data (rug at the foot of the plot) and a kernel density fitted to the simulated data (dotted line).

Convert clock times to sun times
Description Converts a vector of clock times to "sun times", by mapping sunrise to π/2 and sunset to 3π/2. Sunrise and sunset times are determined based on the dates and locations provided. See Nouvellet et al (2012) for a discussion. Requires the maptools package.
Dates a POSIXct object with the dates of the observations; the time zone must be set to the time zone used for 'clockTime'.
Coords a SpatialPoints object with the locations of the observations, or with a single point giving a approximate location for the study area; the coordinates must be geographical coordinates, eg, WGS84, with long before lat.

Value
Returns a vector of "sun times" in radians, where π/2 corresponds to sunrise and 3π/2 to sunset.