fitNSD: Test range shift using net-squared displacement

Description Usage Arguments Details Value Examples

View source: R/fitNSD.R

Description

Test range shift using net-squared displacement

Usage

1
fitNSD(T, X, Y, plotme = FALSE, setpar = TRUE, ...)

Arguments

T

time

X

x coordinate

Y

y coordinate

plotme

whether or not to plot the result

setpar

whether or not to run par(mfrow = c(1,2)) before plotting

...

additional parameters to pass to plot

Details

The test below assumes that the net squared displacement (NSD) for a migrating organism is well characterized by the logistic formula: E(NSD(t)) = a / (1 + exp [(b-t)/c] as described in border=ger and Fryxell (2012). In practice, the square root of the NSD, i.e., the linear displacement, is fitted to the square root of the formula assuming Gaussian residuals with constant variance 's'. A likelihood ratio test against a null model of no-dispersal is provided at a 95% significance level.

Value

a list with a vector of four parameter estimates, and a vector with test statistics (likelihood, AIC and p.values)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# simulate and compare two range shifts 
A <- 20
T <- 1:100
tau <- c(tau.z = 2, tau.v = 0)

# large disperal
Mu <- getMu(T, c(x1 = 0, y1 = 0, x2 = 4, y2 = 4, t1 = 40, dt = 20))
XY.sim <- simulate_shift(T, tau = tau, Mu, A=A)
with(XY.sim, scan_track(time = T, x = X, y = Y))
with(XY.sim, fitNSD(T, X, Y, plotme=TRUE))


# no disperal
Mu <- getMu(T, c(x1 = 0, y1 = 0, x2 = 0, y2 = 0, t1 = 40, dt = 20))
XY.sim <- simulate_shift(T, tau = tau, Mu, A=A)
with(XY.sim, scan_track(time = T, x = X, y = Y))
with(XY.sim, fitNSD(T,X,Y, plotme=TRUE))

marcher documentation built on May 2, 2019, 9:44 a.m.