boutfreqs(x, bw, method=c("standard", "seq.diff"), plot=TRUE, ...)
boutinit(lnfreq, x.break, plot=TRUE, ...)
labelBouts(x, bec, bec.method=c("standard", "seq.diff"))
logit(p)
unLogit(logit)labelBouts it can also be a matrix with
different variables for which bouts should be identified.boutfreqs, arguments passed to hist (must
exclude breaks and include.lowest); for
boutinit, arguments passed to plot (must
exclude type).data.frame with components lnfreq
(log frequencies) and corresponding x (mid points of histogram
bins).x value(s) defining
the break(s) point(s) for broken stick model, such that x <
x.break[1] is 1st process, and x >= x.break[1]
& x < x.break[2] is 2nd one, and x >=
x.break[2] is 3rd one.boutfreqs returns a data frame with components lnfreq
containing the log frequencies and x, containing the
corresponding mid points of the histogram. Empty bins are excluded.
A plot (histogram of input data) is produced as a side effect
if argument plot is TRUE. See the Details section.boutinit returns a list with as many elements as the number of
processes implied by x.break (i.e. length(x.break) + 1).
Each element is a vector of length two, corresponding to a and
lambda, which are starting values derived from broken stick
model. A plot is produced as a side effect if argument plot is
TRUE.labelBouts returns a numeric vector sequentially labelling each
row or element of x, which associates it with a particular bout.unLogit and logit return a numeric vector with the
(un)transformed arguments. boutfreqs creates a histogram with the log transformed
frequencies of x with a chosen bin width and upper limit. Bins
following empty ones have their frequencies averaged over the number
of previous empty bins plus one.
boutinit fits a "broken stick" model to the log frequencies
modelled as a function of x (well, the midpoints of the binned
data), using chosen value(s) to separate the two or three processes.
labelBouts labels each element (or row, if a matrix) of x
with a sequential number, identifying which bout the reading belongs
to. The bec argument needs to have the same dimensions as
x to allow for situations where bec within x.
logit and unLogit are useful for reparameterizing the
negative maximum likelihood function, if using Langton et al. (1995).
Langton, S.; Collett, D. and Sibly, R. (1995) Splitting behaviour into bouts; a maximum likelihood approach. Behaviour 132, 9-10.
Luque, S.P. and Guinet, C. (2007) A maximum likelihood approach for identifying dive bouts improves accuracy, precision, and objectivity. Behaviour, 144, 1315-1332.
Mori, Y.; Yoda, K. and Sato, K. (2001) Defining dive bouts using a sequential differences analysis. Behaviour, 2001 138, 1451-1466.
Sibly, R.; Nott, H. and Fletcher, D. (1990) Splitting behaviour into bouts. Animal Behaviour 39, 63-69.
bouts2.nls, bouts.mle. These
include an example for labelBouts.
## Using the Example from '?diveStats':
utils::example("diveStats", package="diveMove",
ask=FALSE, echo=FALSE)
postdives <- tdrX.tab$postdive.dur[tdrX.tab$phase.no == 2]
## Remove isolated dives
postdives <- postdives[postdives < 2000]
lnfreq <- boutfreqs(postdives, bw=0.1, method="seq.diff", plot=FALSE)
boutinit(lnfreq, 50)
## See ?bouts.mle for labelBouts() example
Run the code above in your browser using DataLab