pf_loglik: Calculate the log-probability of movement paths from a PF...

View source: R/pf_analyse_path.R

pf_loglikR Documentation

Calculate the log-probability of movement paths from a PF algorithm

Description

This function calculates the total log-probability of each movement path reconstructed by a particle filtering (PF) algorithm, including the acoustic-container (AC), depth-contour (DC) or acoustic-container depth-contour (ACDC) algorithms.

Usage

pf_loglik(paths)

Arguments

paths

A dataframe containing movement paths from pf plus pf_simplify (see pf_path-class). At a minimum, this should contain a unique identifier for each path (named ‘path_id’) and the probability associated with each cell along each path (‘cell_pr’).

Details

For each path, at each time step the probability associated with the sampled location depends on (a) the ‘intrinsic’ probability associated with each cell (assigned by the AC, DC or ACDC algorithm) and (b) a user-defined movement model that is driven by the distance between the sampled locations for the individual at the previous and current time steps (and other user-defined parameters). This function simply sums the logarithms of these probabilities for each path as a measure of their relative likelihood, given the movement model.

Value

The function returns a dataframe with the log likelihood (‘loglik’) of each path (‘path_id’). Rows are ordered by log-probability and a ‘delta’ column is provided with the differences in log-probability between the most likely path and every other path.

Author(s)

Edward Lavender

Examples

# An example with the DCPF paths dataset included in flapper
pf_loglik(dat_dcpf_paths)

edwardlavender/flapper documentation built on Jan. 22, 2025, 2:44 p.m.