by J. Bradbury & S. Vehrencamp
This page describes and provides access to three Macintosh programs that may be of use to researchers in animal behavior or field ecology: ANTELOPE, THE KERNEL, and SINGIT! These are available for free to interested users. The authors have sporadic time to devote to their modification and upgrading, so free use comes at the expense of little support. All are offered under copyright by the Regents of the University of California. In addition, some MATLAB ROUTINES for home range computations (including overlap measures) and for temporal cross correlation, correcting for within series autocorrelation, are provided below.
Features include:
SOURCE:
We oversaw a graduate course in spatial and temporal statistics within the Neurobiology and Behavior program at Cornell University in Fall 2000. The course reviewed the relevant statistical methods and worked up routines for them, wherever possible, using Matlab. Several topics overlap with those covered in the stand-alone programs above, so we make them available here. Each week we covered a different topic. This involved presentation of a general review of that topic, a set of Matlab M-files that were useful, and a homework assignment that helped participants understand how to use the methods and the Mfiles. Below we provide the Mfiles and homework assignments for several of the topics. As with the above programs, we accept no responsibility for errors or difficulties you may have with these routines. They work on the most recent versions of Matlab for PC's and on the last MAC version that was commercially available (v. 5.1). Student versions of Matlab may not have all the routines that our Mfiles require.
HOME RANGE TOOLS:
This package deals with the computation of home range area and overlap given one or more files of x,y coordinates. Although a number of methods are available, (minimum convex polygons, elliptical ranges, Fourier smoothing, harmonic mean ranges, and kernel home ranges), we only provide Mfiles for the first and last of these alternatives. These two were the ones judged most robust to boundary conditions, assumptions, and local artifacts. The entire package of Mfiles, homework data, and the assigment (with instructions on how to use the new Mfiles) can be downloaded either as a MAC package or a PC package. The focal Mfiles are:
convexpoly: function A = convexpoly(XY,CXY). This routine accepts either a single two-columned matrix XY containing x,y locations, or a single matrix XY and a cell matrix CXY containing any number of two-columned matrices. In either case, it plots the minimum convex polygon for each submitted matrix and computes its area in the units of the file. The computations are exact (not estimates). If multiple files are submitted, the user can also compute the area of overlap for any subset of the submitted files, and the fraction of each file's polygon occupied by that overlap area. Written by Rulon Clark, Martin Schlaepfer, and Jack Bradbury. Cornell University, December 2000. This unit requires access to Mfiles area, interval, intsecl, iscross, isinpoly, isintpl, linechk, polybool, and polyints written by Kirill K. Pankratov, Massachusetts Institute of Technology, 1995.
kernel: function XYZ = kernel(XY, CXY). This routine computes kernel home range for one (XYZ) or more (XY and CXY) two column matrices. CXY must be a n x 1 cell matrix with a single cell for each submitted matrix. The routine also computes both area and volume overlap estimates for any subset of the submitted matrices. Output is a matrix with the first two columns containing the x,y coordinates of grid points within the sample world and each subsequent column containing the probability of finding the animal in the submitted file at each grid point. This routine requires access to Mfiles changemaps, findh, and overlap. Written by Rulon Clark, Martin Schlaepfer, and Jack Bradbury. Cornell University, December 2000.
TEMPORAL CROSS CORRELATION:
This packet includes tools for extracting correlations from TWO time series, correcting for autocorrelations within each before-hand or as part of the process. There are two ways to do temporal correlations. Lag sequential analysis treats the time series as sequences of discrete events. An excellent program for this can be downloaded for free (GSEQ)The second method assumes continuous variables, (if you have event results, convert the streams to rates) and for this, we have a very sophisticated MFile set. For the entire package of files and data, select MAC or PC format.
macra: function macra(X). This is a shell for running a bidirectional multivariate auto- and cross-regressive analysis on two simultaneous, continuous variable time series. X is a N by 2 rectangular matrix. It plots auto and partial correlations with pacorr.m and then calls the stepwise GIU stpwise.m. Procedure computes the significance of the difference between a regression model with cross regressive plus autoregressive terms and a model without the cross regressive terms, first with one column as the dependent variable and then with the other column as the dependent variable. Written by S. Vehrencamp, Nov. 2000.
pacorr: pacorr(x, n, cor, name). This calculates and plots the serial auocorrelation function and the partial autocorrelation function of x, a column vector, for up to n lags. n should be < N/4, where N is the length of x. The unbiased estimate of r and the progressive Bonferroni correction of alpha are used. name is a string variable with the name of the column. Written by Gerry Middleton, November 1996 & modified by J. Bradbury Sept 2000 and S. Vehrencamp Nov 2000.
stpwise: function stpwise(X,y,inmodel,alpha). An interactive tool for stepwise regression that fits a regression model of Y on the columns of X specified in the vector INMODEL. ALPHA is the significance for testing each term in the model. By default, ALPHA = 1 - (1 - 0.025).^(1/p) where p is the number of columns in X. This translates to plotted 95% simultaneous confidence intervals (Bonferroni) for all the coefficients. The least squares coefficient is plotted with a green filled circle. A coefficient is not significantly different from zero if its confidence interval crosses the white zero line. Significant model terms are plotted using solid lines. Terms not significantly different from zero are plotted with dotted lines. Click on the confidence interval lines to toggle the state of the model coefficients. If the confidence interval line is green the term is in the model. If the confidence interval line is red the term is not in the model. Use the pop-up menu, Export, to move variables to the base workspace. Modified by J. Bradbury Nov. 2000.
Additional m-files called during these routines that you may need to add to your folder (included in your packet): chi2cdf.m, diff.m, fcdf.m, mean.m, std.m, tinv.m
For questions and feedback on these programs, send email to
Last updated: 22 January 2001