inst/examples/ex-rhrSiteFidelity.R

# Simulate a random walk.
set.seed(123)
a <- rhrRW(n = 1000)
plot(a)

# Calcualte site fidelity
sf <- rhrSiteFidelity(a, n = 200)

# For MSD and LI the observed data do not differ significantely from random permutations. 
sf
plot(sf)

# 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. 
sf
#' \dontrun{plot(sf)}

## real data
data(datSH)
res <- rhrSiteFidelity(datSH[, 2:3], n = 200)
res
plot(res)
jmsigner/rhr documentation built on June 26, 2020, 8:59 a.m.