Skip to contents

Computes detection performance metrics including overall detection rates, per-path statistics, and summary statistics across all simulated fish tracks. Works with receiver-specific detection data to create system-level summaries.

Usage

calculate_detection_summaries(simulation_results)

Arguments

simulation_results

List output from simulate_fish_tracks containing tracks and station_detections data frames.

Value

A list containing:

overall

List with total_steps, detected_steps, detection_rate, and detection_percentage

by_path

Data frame with detection statistics for each individual path

by_station

Data frame with detection statistics for each receiver

summary_stats

List with mean, median, min, max, and standard deviation of detection rates

Returns NULL if no detection data is available.

Details

The function analyzes detection success at each step of simulated fish tracks, providing both aggregate and individual path performance metrics. System-level detections are derived from station-level data (a location is "detected" if ANY receiver detected the fish at that location).

Examples

if (FALSE) {
# Simulate fish tracks with detections
fish_sim <- simulate_fish_tracks(
  raster = depth_raster,
  station_distances = distances,
  n_paths = 5,
  n_steps = 100
)

# Calculate detection summaries
detection_stats <- calculate_detection_summaries(fish_sim)

# Access overall performance
overall_rate <- detection_stats$overall$detection_percentage

# Access per-path performance
path_performance <- detection_stats$by_path

# Access per-station performance
station_performance <- detection_stats$by_station
}