# NOT RUN {
# Fit an SSF, then update movement parameters.
#Prepare data for SSF
ssf_data <- deer %>%
steps_by_burst() %>%
random_steps(n = 15) %>%
extract_covariates(sh_forest) %>%
mutate(forest = factor(sh.forest, levels = 1:2,
labels = c("forest", "non-forest")),
cos_ta_ = cos(ta_),
log_sl_ = log(sl_))
# Check tentative distributions
# Step length
attr(ssf_data, "sl_")
# Turning angle
attr(ssf_data, "ta_")
# Fit an iSSF
m1 <- ssf_data %>%
fit_issf(case_ ~ forest +
sl_ + log_sl_ + cos_ta_ +
strata(step_id_))
# Update step length distribution
new_gamma <- update_sl_distr(m1)
#Update turning angle distribution
new_vm <- update_ta_distr(m1)
# }
Run the code above in your browser using DataLab