fitNLSbouts,data.frame-method | R Documentation |
Methods for modelling a mixture of 2 or 3 random Poisson processes to histogram-like data of log frequency vs interval mid points. This follows Sibly et al. (1990) method.
## S4 method for signature 'data.frame' fitNLSbouts(obj, start, maxiter, ...) ## S4 method for signature 'Bouts' fitNLSbouts(obj, start, maxiter, ...)
obj |
Object of class |
start, maxiter |
Arguments passed to |
... |
Optional arguments passed to |
nls
object resulting from fitting this model to data.
data.frame
: Fit NLS model on data.frame
Bouts
: Fit NLS model on Bouts
object
Sebastian P. Luque spluque@gmail.com
Sibly, R.; Nott, H. and Fletcher, D. (1990) Splitting behaviour into bouts Animal Behaviour 39, 63-69.
fitMLEbouts
for a better approach;
boutfreqs
; boutinit
## Run example to retrieve random samples for two- and three-process ## Poisson mixtures with known parameters as 'Bouts' objects ## ('xbouts2', and 'xbouts3'), as well as starting values from ## broken-stick model ('startval2' and 'startval3') utils::example("boutinit", package="diveMove", ask=FALSE) ## 2-process bout2.fit <- fitNLSbouts(xbouts2, start=startval2, maxiter=500) summary(bout2.fit) bec(bout2.fit) ## 3-process ## The problem requires using bound constraints, which is available ## via the 'port' algorithm l_bnds <- c(100, 1e-3, 100, 1e-3, 100, 1e-6) u_bnds <- c(5e4, 1, 5e4, 1, 5e4, 1) bout3.fit <- fitNLSbouts(xbouts3, start=startval3, maxiter=500, lower=l_bnds, upper=u_bnds, algorithm="port") plotBouts(bout3.fit, xbouts3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.