doSpeedCalib {diveMove} | R Documentation |
Calibrate speed readings from a TDR, based on the principles outlined in Blackwell et al. (1999).
doSpeedCalib(rates, speed, calType="pooled", bad=c(0, 0), filename, postscript=FALSE, ...)
rates |
two-element list corresponding to descent and ascent
phases of dives, respectively. Each element should be a 3-column
matrix with dive id, rate of depth change, and mean
speed. |
speed |
numeric vector with uncalibrated speeds. |
calType |
string specifying the type of calibration to perform. It should be one of “descent”, “ascent”, or “pooled”. |
bad |
vector of length 2 indicating values for rate of depth change and mean speed, respectively, below which data should be excluded to build the calibration curve. |
filename |
string indicating name of file to use as base name for the output postscript file. |
postscript |
logical; whether output plot to eps. |
... |
arguments passed to rqPlot; currently, xlab, ylab, and colramp. |
Provide calibrated speeds in a TDR record, using the quantile regression of speed on rate of depth change, based on principles outlined in Blackwell et al. (1999). Choice of calibrating against pooled, or descentr ascent phases.
The function takes the rates of depth change and speed, for each phase
of the dive separately or combined (based on the value of
calType
). It subsequently fits a quantile regression through
the second percentile of the distribution of speed conditional on rate
of depth change. The calibrated speed is s_c=(s_u - a)/b, where s_c is the calibrated
speed, s_u is the uncalibrated speed, and a and
b are the intercept and slope of the quantile regression,
respectively.
If calType
is not “none”, a list of two elements:
coefficients |
numeric vector of length two with the intercept and the slope of the quantile regression defining the calibration curve. |
corrSpeed |
numeric vector as long as speed with the
calibrated speeds. |
A plot (possibly via postscript
, depending on the value
of postscript argument) of the calibration lines for all possible
cases: “descent”, “ascent”, and “pooled”, is
created as a side effect.
Sebastian P. Luque spluque@gmail.com
Blackwell, S. (1999) A method for calibrating swim-speed recorders. Marine Mammal Science 15(3): 894-905.