simLangevinMM: Simulate from the Langevin movement model

View source: R/simLangevinMM.R

simLangevinMMR Documentation

Simulate from the Langevin movement model

Description

This function is based on the Euler approximation.

Usage

simLangevinMM(
  beta,
  gamma2 = 1,
  times,
  loc0,
  cov_list = NULL,
  grad_fun = NULL,
  silent = F,
  keep_grad = F,
  b_box = NULL,
  debug = FALSE
)

Arguments

beta

Vector of resource selection coefficients

gamma2

Scalar speed parameter

times

Vector of times of observations. Should have a small time step between each, such that the Euler scheme is valid

loc0

Vector of coordinates (x,y) of initial location

cov_list

List of J (number of covariates) "raster like" elements. A raster like element is a 3 elements list with named elements 1) "x" a vector of increasing x locations (at which the covariate is sampled) 2) "y" a vector of increasing y locations (at which the covariate is sampled) 3) "z" a size(x)*size(y) matrix giving covariate values at location (x, y)

grad_fun

Optional list of functions taking a 2d vector and returning a two 2d vector for the gradient

silent

logical, should simulation advancement be shown?

keep_grad

should gradient values at simulated points be kept? This avoids to compute gradient later on xgrid and ygrid, of dimensions (length(xgrid),length(ygrid),length(beta)).

b_box

a 2x2 matrix with the minimum value on the first line for x and y and the maximum value on the second line

debug

in debug mode, gradient values are kept in grad.csv file stored in the working directory


papayoun/Rhabit documentation built on July 19, 2023, 8:04 p.m.