y t
10−5 ~N
ey t ∏i=1
Tx i
∞
a
2
1=i
ℝ
L e
AICx iy t ∑i=1
Ti
∫b
109
Using R to study animal movement
Marie Auger-MéthéUniversity of Alberta, Canada
Predicting the impacts of environmental changes
Photos: Dennis Bromage, Wildlife Conservation Society
Monitor behaviours
Photo: Wayne Lynch
Satellite telemetry
Photos: A. Park, C. Franklin, P. Lopez, N. Papathanasopoulou, R. Cameron, S. Anderson, R. Schuckard, L. Thorngren, L. Boehme,C. Jay
Apply models to movement data
Goals my work● 1. Create models for searching strategies
● Basics of creating probability models● Tips for boosting efficiency
● 2. Differentiate between drift and voluntary movement● State-space models● Spatio-temporal data
How do animals search food?
How do animals search food?
Likelihood function
Likelihood● Probability of the data given the model
μ = 0σ = 1
Likelihood● Probability of the data given the model
μ = 0σ = 1
Probability density functions in R● Package: stats
● dnorm(x, mean = 0, sd = 1)
Probability density functions in R● Package: stats
● dnorm(x, mean = 0, sd = 1)● dexp(), dbeta()
● Package: VGAM● dpareto()
● Packages: CircStats● dwrpnorm()
● Packages: Circular● dwrappednormal()
Simulations: R is too slow● R is pretty inefficient in terms of speed● Parallel computing:
● Packages: parallel(), doRNG()● Package: Rcpp
● C++ code in R● http://dirk.eddelbuettel.com/code/rcpp.html● https://github.com/hadley/devtools/wiki/Rcpp
Simulations: error handling● Package: base
> res <- myFx(x)Error ...> res <- tryCatch(myFx(x),
error=function(e) NA)
Simulations: comparing different fx● Package: rbenchmark
> benchmark(myFx1(x), myFx2(x),replications=100)
test replications elapsed ...1 myFx1(x) 100 0.00 ... 2 myFx2(x) 100 70.64 ...
Goals my work● 1. Framework to compare searching strategies
● Basics of creating probability models● Tips for boosting efficiency
● 2. Differentiate between drift and voluntary movement● State-space models● Spatio-temporal data
Differentiating ice drift from bear movement
State-space model
yt = xt + vt + ϵt ϵt~N(µ,σ)yt = xt + vt + ϵt ϵt~N(µ,σ)
xt = ρ xt-1 + ɳt ɳt~N(0,ξ)xt = ρ xt-1 + ɳt ɳt~N(0,ξ)
Observation equation:
Process equation:
Ice movementBear movement
State-space model
State-space model● Package: dlm (with package zoo)
● dlm()● dlmMLE()● dlmFilter(), dlmSmooth()
Spatio-temporal data● Packages: adehabitatLT, adehabitatHR,
adehabitatMA● Packages: raster, sp
Thank you