Skip to main content

calculate_transition_probability

Function calculate_transition_probability 

Source
pub fn calculate_transition_probability(
    route_distance: f64,
    great_circle_distance: f64,
    beta: f64,
) -> f64
Expand description

Calculate transition probability between two map-matched candidates using the Newson & Krumm (2009) formula.

The transition probability penalises candidates whose shortest-path distance through the network deviates from the great-circle distance between the two GNSS observations.

§Formula

exp(-|route_distance - great_circle_distance| / beta)

§Arguments

  • route_distance - Shortest-path distance through the network (meters)
  • great_circle_distance - Great-circle (haversine) distance between the two GNSS positions (meters)
  • beta - Scale parameter controlling tolerance for route/GC mismatch (meters)

§Returns

Probability in (0, 1]. Returns 1.0 when route distance equals great-circle distance.