Description Usage Arguments Value References See Also Examples
View source: R/rhrSiteFidelity.R
Calculates two indices (mean sequared displacement and linearity) to test for site fidelity. Significance testing is done by permuting step lengths and drawing turning angles from a uniform distribution.
1 | rhrSiteFidelity(track, n = 100, alpha = 0.05)
|
track |
Object inheriting |
n |
Numeric scalar. The number of simulated trajectories. |
alpha |
Numeric scalar. The alpha value used for the bootstrapping. |
Object of class RhrFidelity
, which is a list of length 4. msd.dat
and li.dat
is the mean square distance and linearity for the real date. msd.sim
and li.sim
are the mean square distances and linearities for the simulated trajectories.
Spencer, S. R., Cameron, G. N., & Swihart, R. K. (1990). Operationally defining home range: temporal dependence exhibited by hispid cotton rats. Ecology, 1817-1822.
rhrTrack
for fruther details and examples on how to create a RhrTrack*
object.
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 26 27 28 29 30 31 32 | # Simulate a random walk.
set.seed(123)
a <- rhrRW(n = 1000)
## Not run:
plot(a)
## End(Not run)
# Calcualte site fidelity
sf <- rhrSiteFidelity(a, n = 200)
# For MSD and LI the observed data do not differ significantely from random permutations.
## Not run:
plot(sf)
## End(Not run)
# Simulate trajectory as Ornstein-Uhlenbeck process
a <- rhrOU(n = 10000, A = matrix(c(0.1, 0, 0, 0.1), 2))
plot(a)
sf <- rhrSiteFidelity(a, n = 200)
# For MSD and LI the observed data differ significantely from random permutations.
## Not run: plot(sf)
## real data
data(datSH)
res <- rhrSiteFidelity(datSH[, 2:3], n = 200)
## Not run:
plot(res)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.