sim.uncond.3d {eRTG3D} | R Documentation |
Unconditional Empirical Random Walk (UERW) in 3-D
Description
This function creates unconditional walks with prescribed empirical properties (turning angle, lift angle and step length and the auto-differences of them. It can be used for uncon- ditional walks or to seed the conditional walks with comparably long simulations. The conditional walk connecting a given start with a certain end point by a given number of steps needs an attraction term (the Q probability, see qProb.3d) to ensure that the target is approached and hit. In order to calculate the Q probability for each step the distribution of turns and lifts to target and the distribution of distance to target has to be known. They can be derived from the empirical data (ideally), or estimated from an unconditional process with the same properties. Creates a unconditional empirical random walk, with a specific starting point, geometrically similar to the initial trajectory.
Usage
sim.uncond.3d(n.locs, start = c(0, 0, 0), a0, g0, densities, error = TRUE)
Arguments
n.locs |
the number of locations for the simulated track |
start |
vector indicating the start point |
a0 |
initial heading in radian |
g0 |
initial gradient/polar angle in radian |
densities |
list object returned by the get.densities.3d function |
error |
logical: add random noise to the turn angle, lift angle and step length to account for errors measurements? |
Value
A 3 dimensional trajectory in the form of a data.frame
Note
Simulations connecting start and end points
with more steps than 1/10th or more of the number of steps
of the empirical data should rather rely on simulated
unconditional walks with the same properties than on
the empirical data (factor = 1500
).
Random initial heading
For a random initial heading a0 use:
sample(atan2(diff(coordinates(track)[,2]), diff(coordinates(track)[,1])),1)
Examples
sim.uncond.3d(
10, start = c(0, 0, 0), a0 = pi / 2, g0 = pi / 2,
densities = get.track.densities.3d(niclas)
)