fit: Fit a 4M model

Description Usage Arguments Value Examples

Description

Fit a 4M model

Usage

1
2
3
4
5
6
7
## S4 method for signature 'Data4M,SetModel4M'
fit(object, model, max.tries = 10,
  DLL = "markmodmover", stationary.tolerance = 4, ...)

## S4 method for signature 'Data4M,missing'
fit(object, max.tries = 10,
  DLL = "markmodmover", stationary.tolerance = 4, ...)

Arguments

object

An object of class Data4M.

model

An object of class SetModel4M.

max.tries

How many times shoud the fitting process be tried before stopping? Defaults to 10.

DLL

Which DLL should be loaded? Should only be changed if the user modifies the C++ TMB template.

stationary.tolerance

Number of decimal places that any entry of the stationary distribution is allowed to be zero without restarting the fitting procedure.

...

Optional way to define a model without first creating an object. Also used to pass arguments to internal functions.

Value

Returns an object of class Model4M containing estimated model parameters, residuals, and Viterbi-decoded state estimates.

Examples

1
2
3
4
5
6
7
sealData<- data4M(greyseal)
sealData<- interpolate(sealData,Time.Step = 1)
seal4M2<- fit(sealData)
seal4M3<- fit(sealData,N.States = 3)

HMM3<- setModel4M(Use.HMM = T,N.States = 3)
sealHMM3<- fit(sealData,HMM3)

lawlerem/markmodmover documentation built on Feb. 12, 2020, 8:30 p.m.