Skip to contents

Compute either one posterior location per stationary period or one path using the consensus stay/move structure across the ensemble. The function accepts both sampling_path() output and simulation paths with j but no chain column.

Usage

path_summary(
  paths,
  stap = NULL,
  by = c("stap", "consensus_stay"),
  position = c("mean", "median", "mode"),
  move_threshold = 0.5
)

Arguments

paths

A path data frame containing stap_id, ind, lat, and lon, and optionally j, chain, start, and end.

stap

A stationary-period data frame containing stap_id, start, and end. If NULL, these columns are taken from paths.

by

Summary resolution: "stap" returns one row per stationary period; "consensus_stay" returns one row per consensus stay.

position

Position summary: "mean", "median", or "mode". The mode selects the most frequent grid cell and therefore retains a valid ind; the mean and median return NA for ind.

move_threshold

Probability above which a boundary is classified as a move when by = "consensus_stay".

Value

A data frame with one row per requested summary unit and columns stap_id, stap_id_start, stap_id_end, ind, lat, lon, start, end, and n_path. Consensus summaries also contain movement probabilities at the start and end boundaries.

See also

Other path: path_collapse()