Description Usage Arguments Value See Also Examples
sim_brownian_backward
returns a simulated realisation of Brownian motion with known end value and start/end times.
1 | sim_brownian_backward(num_states, fixed_values, times, behavs, variance)
|
num_states |
Numeric, number of (behavioural) states that the Brownian motion will simulate over. |
fixed_values |
List with components:
|
times |
Vector (length variable) of the times at which the brownian motion is to be simulated over (including the start time). |
behavs |
Vector (length variable but equal to |
variance |
Vector of length |
Vector (length variable but equal to times
) of the simulated Brownian motion (not including known end point).
Other Brownian motion simulations: sim_brownian_bridge
,
sim_brownian_forward
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 | num_states <- 2
fixed_values <- list(time = 10,
bearing = 2.3)
times <- seq(0, 10, length.out = 22)[-22]
behavs <- c(rep(1, 6), rep(2, 9), rep(1, 3), rep(2, 3))
variance <- c(0.3, 1.5)
set.seed(123)
sim_brownian_backward(num_states, fixed_values, times, behavs, variance)
# [1] 2.210662 1.998823 1.911824 2.500960 2.527610 2.576476 3.224709 3.614255 2.545083 1.964586
# [11] 1.587933 2.622471 2.926569 3.265283 3.358827 2.889055 3.564445 3.752615 3.009303 3.602057
# [21] 3.202476
num_states <- 2
fixed_values <- list(time = 10,
bearing = 2.3)
times <- seq(0, 10, length.out = 22)[-22]
behavs <- rep(1, 21)
variance <- c(0.03, 1.5)
set.seed(2712)
sim_brownian_backward(num_states, fixed_values, times, behavs, variance)
# [1] 2.439727 2.533936 2.586692 2.596769 2.267357 2.350119 2.591627 2.515462 2.531663 2.719289
# [11] 2.697561 2.572232 2.618390 2.619669 2.705751 2.734348 2.720683 2.616551 2.512080 2.555922
# [21] 2.424459
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.