dsdive.obsld: Likelihood for collection of partially observed dives

Description Usage Arguments Examples

View source: R/dsdive.obsld.R

Description

Likelihood for collection of partially observed dives

Usage

1
dsdive.obsld(dsobs.list, t.stages.list, P.raw, s0, sf)

Arguments

dsobs.list

list of dsobs objects, which describe the observation times and depths of a collection of dives

t.stages.list

list of stage transition times for dives observed in dsobs.list

P.raw

list of continuous time probability transition matrices, and components.

s0

likelihood should include contributions for stages greater or equal to s0

sf

likelihood should include contributions for stages less than or equal to sf

Examples

 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
library(dsdive)
data('dive.sim')
attach(dive.sim)
attach(dive.sim$params)

# extract time between observations
tstep = diff(sim.obs$times[1:2])

# get true stage transition times
t.stages = sim$times[c(FALSE, diff(sim$stages)==1)]

# build probability matrices for observations
obstx.mat = lapply(1:3, function(s) {
  dsdive.obstx.matrix(depth.bins = depth.bins, beta = dive.sim$params$beta, 
                      lambda = lambda, 
                      s0 = s, tstep = tstep, include.raw = TRUE, delta = 1e-10)
})

# compute likelihood of observations, given model parameters
ld = dsdive.obsld(dsobs.list = list(sim.obs,sim.obs),
                  t.stages.list = list(t.stages,t.stages), 
                  P.raw = obstx.mat, s0 = 1, sf = 3)

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

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