Creates a conditional empirical random walk, with a specific starting and ending point, geometrically similar to the initial trajectory (extractMethod: raster overlay method can take "simple" or "bilinear")

sim.cond.3d(
  n.locs,
  start = c(0, 0, 0),
  end = start,
  a0,
  g0,
  densities,
  qProbs,
  error = FALSE,
  DEM = NULL,
  BG = NULL
)

Arguments

n.locs

length of the trajectory in locations

start

numeric vector of length 3 with the coordinates of the start point

end

numeric vector of length 3 with the coordinates of the end point

a0

initial incoming heading in radian

g0

initial incoming gradient/polar angle in radian

densities

list object returned by the get.densities.3d function

qProbs

list object returned by the qProb.3d function

error

logical: add random noise to the turn angle, lift angle and step length to account for errors measurements?

DEM

raster layer containing a digital elevation model, covering the area between start and end point

BG

a background raster layer that can be used to inform the choice of steps

Value

A trajectory in the form of data.frame

Examples

niclas <- track.properties.3d(niclas)
n.locs <- 3
P <- get.track.densities.3d(niclas)
#>   |TLD cube dimensions: 9 x 14 x 3
f <- 1500
start <- Reduce(c, niclas[1, 1:3])
end <- Reduce(c, niclas[n.locs, 1:3])
a0 <- niclas$a[1]
g0 <- niclas$g[1]
uerw <- sim.uncond.3d(
  n.locs * f, start = start, a0 = a0, g0 = g0, densities = P
)
#>   |Simulate UERW with 4500 steps
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |====                                                                  |   5%
  |                                                                            
  |=======                                                               |  10%
  |                                                                            
  |===========                                                           |  15%
  |                                                                            
  |==============                                                        |  20%
  |                                                                            
  |==================                                                    |  25%
  |                                                                            
  |=====================                                                 |  30%
  |                                                                            
  |=========================                                             |  35%
  |                                                                            
  |============================                                          |  40%
  |                                                                            
  |================================                                      |  45%
  |                                                                            
  |===================================                                   |  50%
  |                                                                            
  |=======================================                               |  55%
  |                                                                            
  |==========================================                            |  60%
  |                                                                            
  |==============================================                        |  65%
  |                                                                            
  |=================================================                     |  70%
  |                                                                            
  |=====================================================                 |  75%
  |                                                                            
  |========================================================              |  80%
  |                                                                            
  |============================================================          |  85%
  |                                                                            
  |===============================================================       |  90%
  |                                                                            
  |===================================================================   |  95%
  |                                                                            
  |======================================================================| 100%
#>   |Elapsed time: 0.3s
Q <- qProb.3d(uerw, n.locs)
#>   |Extracting Q probabilities for 3 steps
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======================================================================| 100%
#>   |Elapsed time: 0s
sim.cond.3d(
  n.locs = n.locs, start = start, end = end,
  a0 = a0, g0 = g0, densities = P, qProbs = Q
)
#>   |Simulate CERW with 3 steps
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |======================================================================| 100%
#>   |Elapsed time: 0s
#>         x       y        z         a        g          t           l        d
#> 1 2556476 1188336 1283.736 0.3914766 1.557032 0.23629734 -0.03443615       NA
#> 2 2558851 1189402 1350.465 0.4220587 1.545164 0.03058205 -0.01186791 2603.554
#> 3 2560477 1189861 1369.713        NA       NA         NA          NA 1689.868
#>              p
#> 1           NA
#> 2 1.865802e-17
#> 3           NA