dosim: Simulates 2-plane data & fits LCE and CCR models to this

Description Usage Arguments

View source: R/twoplanesim.r

Description

Simulates 2-plane data & fits LCE and CCR models to this

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
dosim(
  D.2D,
  L,
  w,
  b,
  sigmarate,
  k,
  planespd,
  kappa,
  tau,
  p = c(1, 1),
  movement = list(forward = TRUE, sideways = TRUE),
  fix.N = TRUE,
  En = NULL,
  Nsim = 100,
  writeout = TRUE,
  seed = 1,
  simethod = "MLE",
  control.opt = control.opt,
  hessian = TRUE,
  adj.mvt = FALSE,
  ft.normal = FALSE,
  sim.ft.normal = FALSE,
  progbar = TRUE,
  fn.append = NULL
)

Arguments

D.2D

animal density (number per sq km)

L

transect length (km)

w

searched strip width (km)

b

buffered strip width (km)

sigmarate

the Brownian movement rate (sigma) parameter

k

the lag between observers (seconds)

planespd

Observer speed in km/sec

kappa

mean time animals on surface (seconds)

tau

mean dive cycle leength (seconds)

p

vector of each observers' detection prob for available animals

movement

list with components forward and sideways, which should be TRUE or FALSE depending on what sort of movement you want to simulate with. Note: Estimation does not currently work when simulating with forward=FALSE.

fix.N

Boolean variable, which if TRUE simulates with the same abundance, equal to the expected, abundance, each simulation rep.

En

Ignored if NULL, else the expected number of detections by each observer. Function sets transect length, L, to achieve this

Nsim

Number of simulations to do

writeout

Boolean, which if TRUE, causes results to be written to file and the name of the file (which encodes the simulation parameters) to be returned invisibly.

seed

Integer seed which can be used for repoducible results

control.opt

passed to optim

hessian

Boolean controlling whether or not to return Hessian (and interval estimates for MLE method).

adj.mvt

If TRUE, MLE method takes account of randomness in lag between encounters; if FALSE, it sets these all to the lag, k.

ft.normal

if TRUE, approximates Brownian motion hitting time with a normal distribution when estimation with MLE method, else uses exact expression for Brownian hitting time

sim.ft.normal

if TRUE, approximates Brownian motion hitting time with a normal distribution when simulating, else uses exact expression for Brownian hitting time in simulation. NOTE: Exact simulator seems to have too low variance; with fast observers relative to animals, normal approx is very good (see function dft and code in file ft_plot.R).

progbar

If TRUE, puts a progress bar on screen so you can monitor simulation progress.

fn.append

A text string to append to the default output file name.

simthod

Character; either 'MLE' (for max likelihood simulator) or 'Palm' for CCR simulator from package palm.


david-borchers/LCE_paper documentation built on Nov. 15, 2020, 1:33 p.m.