| boutinit,data.frame-method {diveMove} | R Documentation |
Fit "broken stick" model to log frequency data for identification of bouts of behaviour
Description
Fits "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.
Usage
## S4 method for signature 'data.frame'
boutinit(obj, x.break, plot = TRUE, ...)
## S4 method for signature 'Bouts'
boutinit(obj, x.break, plot = TRUE, ...)
Arguments
obj |
Object of class |
x.break |
Numeric vector of length 1 or 2 with |
plot |
logical, whether to plot results or not. |
... |
arguments passed to |
Value
(2,N) matrix with as many columns as the number of processes
implied by x.break (i.e. length(x.break) + 1). Rows
are named a and lambda, corresponding to starting
values derived from broken stick model. A plot is produced as a
side effect if argument plot is TRUE.
Methods (by class)
-
data.frame: Fit "broken-stick" model ondata.frameobject -
Bouts: Fit "broken-stick" model onBoutsobject
Author(s)
Sebastian P. Luque spluque@gmail.com
Examples
## 2-process
utils::example("rmixexp", package="diveMove", ask=FALSE)
## 'rndproc2' is a random sample vector from the example
xbouts2 <- boutfreqs(rndprocs2, 5) # Bouts class result
(startval2 <- boutinit(xbouts2, 80))
## 3-process
## 'rndproc3' is a random sample vector from the example
xbouts3 <- boutfreqs(rndprocs3, 5)
(startval3 <- boutinit(xbouts3, c(75, 220)))