update_bearing_param: Simulate bearing parameters.

Description Usage Arguments Value Examples

Description

update_bearing_param returns a conditional Gibbs sample of the bearing parameters.

Usage

1
update_bearing_param(fixed_constant, refined_path)

Arguments

fixed_constant

List with components:

num_states

Numeric, number of behavioural states.

turn_prec_prior

List with components:

rate

Vector (length num_states) with prior rate of the turn precision (not variance).

shape

Vector (length num_states) with prior shape of the turn precision (not variance).

refined_path

List with components:

times

Vector of the refined times on the path.

behavs

Vector of refined behaviours.

bearings

Vector of refined bearings

Value

Vector, sampled bearing variances for each behavioural state.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
const <- list(num_states = 3,
              turn_prec_prior = list(rate = c(1, 2, 3),
                                     shape = c(0.1, 0.2, 0.3)))
path <- list(times = 1:20,
             behavs = c(1, 1, 1, 1, 2, 2, 2, 3, 1, 1, 3, 3, 3, 2, 2, 2, 2, 2, 2),
             bearings = cumsum(rnorm(19, 0, 1)))

set.seed(1234)
update_bearing_param(const, path)
# [1] 4.8920033 0.8789057 1.7115489

set.seed(765)
update_bearing_param(const, path)
# [1] 2.0455226 0.7477887 2.6614361

a-parton/CTStepTurn documentation built on May 14, 2019, 4:17 p.m.