fit a random walk with time-varying move persistence to temporally regular or irregular location data

fit_mpm(
  x,
  what = "predicted",
  model = c("jmpm", "mpm"),
  coords = 3:4,
  control = mpm_control(),
  inner.control = NULL,
  optim = NULL,
  optMeth = NULL,
  verbose = NULL
)

Arguments

x

a ssm_df fit object or a data frame of observations (see details)

what

if a ssm_df fit object is supplied then what determines whether fitted, predicted (default), or rerouted values are mapped; ignored if x is a data frame

model

mpm model to fit; either mpm with unpooled random walk variance parameters (sigma_(g,i)) or jmpm with a single, pooled random variance parameter (sigma_g)

coords

column numbers of the location coordinates (default = 3:4)

control

list of control settings for the outer optimizer (see mpm_control for details)

inner.control

list of control parameters for the inner optimization

optim

is deprecated, use ssm_control(optim = "optim") instead, see ssm_control for details

optMeth

is deprecated, use ssm_control(method = "L-BFGS-B") instead, see ssm_control for details

verbose

is deprecated, use ssm_control(verbose = 1) instead, see ssm_control for details

Value

a list with components

  • fitted a dataframe of fitted locations

  • par model parameter summary

  • data input data.frame

  • tmb the TMB object

  • opt the object returned by the optimizer

References

Jonsen ID, McMahon CR, Patterson TA, et al. (2019) Movement responses to environment: fast inference of variation among southern elephant seals with a mixed effects model. Ecology. 100(1):e02566

Examples

## fit jmpm to two southern elephant seal tracks
xs <- fit_ssm(sese2, spdf=FALSE, model = "rw", time.step=72, control = ssm_control(verbose = 0))
#> 
#> 

fmpm <- fit_mpm(xs, model = "jmpm")
#> fitting jmpm...
#> 
 pars:   0 0 0      
 pars:   -0.63018 -0.77433 0.05731      
 pars:   -0.21925 -0.90513 0.95955      
 pars:   -0.08786 -0.20745 0.25528      
 pars:   -0.18067 -0.7003 0.75278      
 pars:   -0.42894 -0.54449 0.73596      
 pars:   -0.45937 -0.82886 0.66962      
 pars:   -0.39279 -0.70181 0.63844      
 pars:   -0.2662 -0.72981 0.37502      
 pars:   -0.36963 -0.70693 0.59025      
 pars:   -0.38254 -0.70407 0.61711      
 pars:   -0.40271 -0.6999 0.60524      
 pars:   -0.41907 -0.69089 0.56152      
 pars:   -0.41907 -0.69089 0.56152