sim_filter | R Documentation |
sim_fit
simulationsThis function calculates the similarity between the simulations
generated by sim_fit
and the SSM-estimated path from the ssm
fit,
and returns a sim_fit
object containing the most similar tracks based on
a user specified quantile. In this context, similarity is calculated
as the sum of normalised differences in net displacement (km) and overall
bearing (deg) between the SSM-estimated path and the simulated paths.
sim_filter(trs, keep = 0.25, flag = 2, var = NULL, FUN = "mean", ...)
trs |
a |
keep |
the quantile of flag values to retain |
flag |
the similarity flag method (see details). Ignored if var != NULL. |
var |
the name(s) of the appended variable(s) to use for similarity calculations. Default is NULL, in which case similarity is calculated based on distance and bearing - e.g., Hazen et al (2017). |
FUN |
one of the following functions in quotes: mean, median, var, sd, sum, min, or max. Ignored if var = NULL. |
... |
additional arguments to the specified FUN (e.g., na.rm = TRUE). Ignored if var = NULL. |
flag = 1
will use an index based on Hazen (2017)
flag = 2
(the default) will use a custom index
a sim_fit
object containing the filtered paths
Hazen et al. (2017) WhaleWatch: a dynamic management tool for predicting blue whale density in the California Current J. Appl. Ecol. 54: 1415-1428
## fit crw model to Argos LS data
fit <- fit_ssm(ellie, model = "crw", time.step = 72)
set.seed(pi)
## generate 5 simulated paths from ssm fit
trs <- sim_fit(fit, what = "predicted", reps = 5)
## filter simulations and keep paths in top 40% of flag values
trs_f <- sim_filter(trs, keep = 0.4, flag = 2)
## compare unfiltered and filtered simulated paths
plot(trs) | plot(trs_f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.