Helper function that processes elements of the distance matrix for calculating convergence error. Handles threshold indicators and NA values.
process_distance_matrix(reported_distance, distance)
Numeric or NA. Returns processed distance if valid, NA otherwise
Character or numeric. The reported distance value
Numeric. The calculated distance to compare against