+ All Categories
Home > Documents > Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3....

Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3....

Date post: 23-Jan-2021
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
22
y t 10 5 ~ N e y t i =1 T x i a 2 1 =i L e AIC x i y t i =1 T b 10 9 Using R to study animal movement Marie Auger-Méthé University of Alberta, Canada
Transcript
Page 1: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

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

Page 2: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Predicting the impacts of environmental changes

Photos: Dennis Bromage, Wildlife Conservation Society

Page 3: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Monitor behaviours

Photo: Wayne Lynch

Page 4: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Satellite telemetry

Photos: A. Park, C. Franklin, P. Lopez, N. Papathanasopoulou, R. Cameron, S. Anderson, R. Schuckard, L. Thorngren, L. Boehme,C. Jay

Page 5: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Apply models to movement data

Page 6: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

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

Page 7: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

How do animals search food?

Page 8: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

How do animals search food?

Likelihood function

Page 9: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Likelihood● Probability of the data given the model

μ = 0σ = 1

Page 10: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Likelihood● Probability of the data given the model

μ = 0σ = 1

Page 11: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Probability density functions in R● Package: stats

● dnorm(x, mean = 0, sd = 1)

Page 12: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Probability density functions in R● Package: stats

● dnorm(x, mean = 0, sd = 1)● dexp(), dbeta()

● Package: VGAM● dpareto()

● Packages: CircStats● dwrpnorm()

● Packages: Circular● dwrappednormal()

Page 13: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

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

Page 14: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Simulations: error handling● Package: base

> res <- myFx(x)Error ...> res <- tryCatch(myFx(x),

error=function(e) NA)

Page 15: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

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 ...

Page 16: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

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

Page 17: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Differentiating ice drift from bear movement

Page 18: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

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:

Page 19: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Ice movementBear movement

State-space model

Page 20: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

State-space model● Package: dlm (with package zoo)

● dlm()● dlmMLE()● dlmFilter(), dlmSmooth()

Page 21: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Spatio-temporal data● Packages: adehabitatLT, adehabitatHR,

adehabitatMA● Packages: raster, sp

Page 22: Using R to study animal movement - Meetupfiles.meetup.com/2755912/DublinR_AnimalMov.pdf · 2013. 3. 11. · yt 10−5 ~ N y e t ∏ i=1 T xi a 2 1 =i ℝ L e AIC xiyt i=1 T i ∫b

Thank you


Recommended