simulate from the rw, crw, or mp process models to generate a set of x,y (or lon,lat) coordinates with or without error from supplied input parameters.

sim(
  N = 100,
  start = list(c(0, 0), as.POSIXct(format(Sys.time(), tz = "UTC", usetz = TRUE))),
  model = c("rw", "crw", "mp"),
  vmax = 4,
  sigma = c(4, 4),
  rho_p = 0,
  D = 0.05,
  sigma_g = 1.25,
  error = c("ls", "kf"),
  tau = c(1.5, 0.75),
  rho_o = 0,
  tdist = c("reg", "gamma"),
  ts = 6,
  tpar = 1.2,
  alpha = c(0.9, 0.8)
)

Arguments

N

number of time steps to simulate

start

coordinates and datetime of start location for simulated track

model

simulate from the rw, crw or mp process models

vmax

maximum travel rate (m/s) of simulated animal

sigma

a vector of process error sd's for the rw model (ignored if model != "rw")

rho_p

correlation parameter for rw model process covariance matrix (ignored if model != "rw")

D

diffusion coefficient for crw model process covariance matrix (ignored if model != "crw")

sigma_g

random walk sd for time-varying move persistence parameter (ignored if model != "mp")

error

indicates whether measurement error should mimic Argos Least-Squares (ls) or Argos Kalman Filter (kf)

tau

vector of LS measurement error sd's (ignored if error = "kf")

rho_o

correlation parameter for LS covariance matrix (ignored if error = "kf")

tdist

distribution for simulating location times (reg generates locations at regular ts intervals, in h; gamma uses a gamma distribution to generate random time intervals)

ts

time interval in h

tpar

rate parameter for the gamma distributed times, shape is take to be ts * tpar for a mean interval of approximately ts h (ignored if tdist = "reg")

alpha

transition probabilities switching model versions of rw or crw models. Probabilities are the transition matrix diagonals (ignored if sigma has length 2 or D has length 1)

Value

a tibble is returned with columns that can include some or all of the following, depending on the arguments used

  • date time as POSIXct, tz = UTC (default)

  • lc Argos location class

  • lon longitude with error

  • lat latitude with error

  • x x in km from arbitrary origin without error

  • y y in km from arbitrary origin without error

  • x.err a random deviate drawn from Argos LS or KF error distribution

  • y.err a random deviate drawn from Argos LS or KF error distribution

  • smaj Argos error ellipse semi-major axis in m (if error = "kf")

  • smin Argos error ellipse semi-minor axis in m (if error = "kf")

  • eor Argos error ellipse orientation in degrees (if error = "kf")

  • u velocity in x direction (if model = "crw"), unit = km/h

  • v velocity in y direction (if model = "crw"), unit = km/h

  • b behavioural state (if model = "rw" or model = "crw" and multiple process variances given, see examples)

  • g movement persistence - the autocorrelation between successive movements on the interval 0,1 (if model = "mp")

Examples

tr <- sim(N = 200, model = "crw", D = 0.1, error = "kf", tdist = "reg", ts=12)
plot(tr, error = TRUE)


tr <- sim(N = 200, model = "mp", sigma_g = 1.2, error = "ls", tau = c(2, 1.5), ts=12,
tdist = "gamma", tpar = 1.5)
plot(tr, error = TRUE, pal = "Cividis")