changeLight | R Documentation |
Function to discriminate between periods of residency and movement based on
consecutive sunrise and sunset data. The calculation is based on a
changepoint model (R Package changepoint
:
cpt.mean
) to find multiple changepoints within the
data.
changeLight(
tFirst,
tSecond,
type,
twl,
quantile = 0.9,
rise.prob = NA,
set.prob = NA,
days = 5,
fixed = NULL,
plot = TRUE,
summary = TRUE
)
tFirst |
vector of sunrise/sunset times (e.g. 2008-12-01 08:30). |
tSecond |
vector of of sunrise/sunset times (e.g. 2008-12-01 17:30). |
type |
vector of either 1 or 2, defining |
twl |
data.frame containing twilights and at least |
quantile |
probability threshold for stationary site selection. Higher
values (above the defined quantile of all probabilities) will be considered
as changes in the behavior. Argmuent will only be considered if either |
rise.prob |
the probability threshold for sunrise: greater or equal values indicates changes in the behaviour of the individual. |
set.prob |
the probability threshold for sunset: higher and equal values indicates changes in the behaviour of the individual. |
days |
a threshold for the length of stationary period. Periods smaller than "days" will not be considered as a residency period |
fixed |
... |
plot |
logical, if |
summary |
logical, if |
The cpt.mean
from the R
Package changepoint
is a
function to find a multiple changes in mean for data where no assumption is
made on their distribution. The value returned is the result of finding the
optimal location of up to Q changepoints (in this case as many as possible)
using the cumulative sums test statistic.
A list
with probabilities for sunrise and
sunset the user settings of the probabilities and the resulting
stationary periods given as a vector
, with the residency sites as
positiv numbers in ascending order (0 indicate movement/migration).
The sunrise and/or sunset times shown in the graph (if
plot=TRUE
) represent hours of the day. However if one or both of the
twilight events cross midnight during the recording period the values will
be formed to avoid discontinuity.
Simeon Lisovski & Tamara Emmenegger
Taylor, Wayne A. (2000) Change-Point Analysis: A Powerful New Tool For Detecting Changes.
M. Csorgo, L. Horvath (1997) Limit Theorems in Change-Point Analysis. Wiley.
Chen, J. and Gupta, A. K. (2000) Parametric statistical change point analysis. Birkhauser.
changepoint
, cpt.mean
data(hoopoe2)
hoopoe2$tFirst <- as.POSIXct(hoopoe2$tFirst, tz = "GMT")
hoopoe2$tSecond <- as.POSIXct(hoopoe2$tSecond, tz = "GMT")
residency <- changeLight(hoopoe2, quantile=0.9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.