similarity_flag: Add similarity flag value to a 'sim_fit' object

View source: R/similarity_flag.R

similarity_flagR Documentation

Add similarity flag value to a sim_fit object

Description

Calculate the similarity between a single path generated by sim_fit and the observed path used in the SSM fit. 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. Similarity flag values are based on two interpretations of the difference in overall distance and bearing between the two paths.

Usage

similarity_flag(track, sim_track, flag = 2, cpf)

Arguments

track

a dataframe containing longitude and latitudes of the observed path used in the SSM fit

sim_track

a dataframe containing the longitude and latitude of a single simulated path from sim_fit

flag

set to either 1 or 2 to define similarity index (see details)

cpf

logical; are tracks simulated as central place foraging trips. If cpf = TRUE then distance & bearing are calculated from the first location to the most distant location, otherwise distance & bearing are calculated from the first to the last location on each track.

Details

flag = 1 will use an index based on Hazen (2017)
flag = 2 (the default) will use a custom index

Value

a single value representing the similarity in distance and bearing between the two paths


ianjonsen/foieGras documentation built on Jan. 17, 2025, 11:15 p.m.