trajectory_metrics: Trajectory metrics from a belief trajectory matrix

View source: R/belief_trajectory.R

trajectory_metricsR Documentation

Trajectory metrics from a belief trajectory matrix

Description

Computes all trajectory-level metrics for a belief trajectory: entropy at each step, per-step Kullback-Leibler divergence (Bayesian surprise), cumulative divergence from the prior, per-step total-variation distance, total path length, and a family of concentration indices (max/sum, Herfindahl, Shannon-based).

Usage

trajectory_metrics(traj_matrix)

Arguments

traj_matrix

Matrix. Output from belief_trajectory with rows indexing time steps (row 1 = prior, row T+1 = final posterior) and columns indexing hypotheses.

Value

A list with components:

entropy

Numeric vector of length T+1: Shannon entropy at each step.

kl_step

Numeric vector of length T: per-step Kullback-Leibler divergence D_{\mathrm{KL}}(P_t \| P_{t-1}), equivalently Bayesian surprise (Itti & Baldi, 2009).

kl_from_prior

Numeric vector of length T+1: cumulative Kullback-Leibler divergence from the prior, D_{\mathrm{KL}}(P_t \| P_0).

tv_step

Numeric vector of length T: per-step total-variation distance \mathrm{TV}(P_t, P_{t-1}).

path_length

Numeric scalar. Total path length in total-variation distance, \sum_t \mathrm{TV}(P_t, P_{t-1}).

concentration

Numeric scalar. Max/sum concentration index based on per-step information gains (see concentration_index).

concentration_herfindahl

Numeric scalar. Herfindahl concentration (see herfindahl_index).

concentration_shannon

Numeric scalar. Shannon-based concentration (see shannon_concentration).

References

Marsico, F. L. & Egeland, T. (in preparation). Belief dynamics during the investigative process. Itti, L. & Baldi, P. (2009). Bayesian surprise attracts human attention. Vision Research 49, 1295-1306.

See Also

belief_trajectory, entropy_log10, kl_divergence_log10, concentration_index.

Examples

prior <- c(0.5, 0.5)
lrs <- list(c(3, 1), c(1, 2), c(2, 1))
traj <- belief_trajectory(prior, lrs)
metrics <- trajectory_metrics(traj)
str(metrics)


mispitools documentation built on Aug. 26, 2026, 1:08 a.m.