dsdive.fwdsample.fixedstage: Simulate a dive trajectory within a single stage

Description Usage Arguments Value Examples

View source: R/dsdive.fwdsample.fixedstage.R

Description

The method will simulate dive trajectories from initial conditions until the trajectory is observable at tf, or a maximum number of transitions has been exceeded. The dive segment will only be simulated using parameters for a single dive stage s0.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
dsdive.fwdsample.fixedstage(
  depth.bins,
  d0,
  beta,
  lambda,
  t0,
  tf,
  steps.max,
  dur0 = NULL,
  nsteps = NULL,
  s0
)

Arguments

depth.bins

n x 2 Matrix that defines the depth bins. The first column defines the depth at the center of each depth bin, and the second column defines the half-width of each bin.

d0

the depth bin index at which the dive segment begins

beta

Directional preference model parameters. See dsdive.tx.params for more details.

lambda

Diving rate model parameters. See dsdive.tx.params for more details.

t0

Initial time for the dive segment

tf

Final time for the dive segment

steps.max

maximum number of transitions to sample before stopping, regardless of whether tf is reached.

dur0

time spent at location d0. If NULL, then a duration in state d0 will be sampled first, otherwise a new state will be sampled first, then sampling will continue from the new state at time t0 + dur0.

nsteps

if nsteps is not NULL, then the sampler will be reconfigured to sample exactly nsteps transitions instead of attempting to sample until the trajectory is observable at time tf.

s0

dive stage in which forward simulation begins

Value

A dsdive object, which is a list with the following vectors:

depths

Record of which depth bin indices the trajectory visited

durations

Record of amount of time spent in each depth bin

times

The time at which each depth bin was entered

stages

The stage at which each depth bin was entered

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data('dive.sim')
attach(dive.sim)
attach(dive.sim$params)

# simulate dive
x = dsdive.fwdsample.fixedstage(depth.bins = depth.bins, d0 = 1, 
                                beta = beta, lambda = lambda, t0 = 0, 
                                tf = 100, steps.max = 1e3, s0 = 1)

pl = plot(x = x, depth.bins = depth.bins)

detach(dive.sim$params)
detach(dive.sim)

jmhewitt/dsdive documentation built on May 29, 2020, 5:18 p.m.