fit_ssm: Fit a continuous-time state-space model to filter Argos...

Description Usage Arguments Value Examples

Description

fits either a simple random walk or a correlated random walk (a random walk on velocity) in continuous time to filter Argos KF and/or LS data and predict locations at user-specified time intervals (regular or irregular)

Usage

1
2
3
4
fit_ssm(d, vmax = 50, ang = -1, distlim = c(2500, 5000),
  spdf = TRUE, min.dt = 60, pf = FALSE, model = "rw",
  time.step = 6, parameters = NULL, fit.to.subset = TRUE,
  optim = "nlminb", verbose = 1, inner.control = NULL)

Arguments

d

a data frame of observations including Argos KF error ellipse info

vmax

max travel rate (m/s) passed to argosfilter::sdafilter to define outlier locations

ang

angles of outlier location "spikes" - see ?argosfilter::sdafilter for details

distlim

lengths of outlier location "spikes" - see ?argosfilter::sdafilter for details

spdf

(logical) turn argosfilter::sdafilter on (default; TRUE) or off

min.dt

minimum allowable time difference between observations; dt <= min.dt will be ignored by the SSM

pf

just pre-filter the data, do not fit the ctrw (default is FALSE)

model

fit either a simple random walk ("rw") or correlated random walk ("crw") as a continuous-time process model

time.step

the regular time interval, in hours, to predict to. Alternatively, a vector of prediction times, possibly not regular, must be specified as a data.frame with id and POSIXt dates.

parameters

a list of initial values for all model parameters and unobserved states, default is to let sfilter specifiy these. Only play with this if you know what you are doing...

fit.to.subset

fit the SSM to the data subset determined by prefilter (default is TRUE)

optim

numerical optimizer to be used ("nlminb" or "optim")

verbose

report progress during minimization; 0 for complete silence; 1 for progress bar only; 2 for minimizer trace but not progress bar

inner.control

list of control settings for the inner optimization (see ?TMB::MakeADFUN for additional details)

Value

a list with components

call

the matched call

predicted

an sf tbl of predicted location states

fitted

an sf tbl of fitted locations

par

model parameter summmary

data

an augmented sf tbl of the input data

inits

a list of initial values

pm

the process model fit, either "rw" or "crw"

ts

time time.step in h used

opt

the object returned by the optimizer

tmb

the TMB object

rep

TMB sdreport

aic

the calculated Akaike Information Criterion

time

the processing time for sfilter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## fit crw model to multiple individuals with Argos LS data
data(ellie)
fit <- fit_ssm(ellie, model = "rw", time.step = 24)
plot(fit$ssm[[1]])


data(rope)
fls <- fit_ssm(rope, model = "crw", time.step = 12)

## simple diagnostic plot for individual 3,
## showing predicted value time-series
plot(fls$ssm[[3]], what = "predicted")

bmcclintock/crwHMM documentation built on May 7, 2019, 12:51 a.m.