maritime_compare_speed_groups
Compare sailing speed distributions between two time periods using Mann-Whitney U test and Cohen's d effect size.
Instructions
Compare sailing speed distributions between two time periods.
Computes daily speeds for each period, then runs a Mann-Whitney U test to determine if the difference is statistically significant. Also returns Cohen's d effect size.
Args: period1_years: First period as "YYYY/YYYY" range or "YYYY,YYYY,..." list period2_years: Second period as "YYYY/YYYY" range or "YYYY,YYYY,..." list lat_min: Minimum latitude for position bounding box lat_max: Maximum latitude for position bounding box lon_min: Minimum longitude for position bounding box lon_max: Maximum longitude for position bounding box nationality: Filter tracks by nationality code direction: Filter by "eastbound" or "westbound" month_start: Filter by start month (1-12). Supports wrap-around month_end: Filter by end month (1-12). Used with month_start aggregate_by: Unit of analysis — "observation" (default) or "voyage" (one mean per voyage, statistically independent) include_samples: If True, include raw speed arrays in response min_speed_km_day: Minimum speed filter (default: 5.0) max_speed_km_day: Maximum speed filter (default: 400.0) wind_force_min: Minimum Beaufort force (0-12). Requires wind data wind_force_max: Maximum Beaufort force (0-12). Requires wind data exclude_years: Years to exclude from both periods, as "YYYY/YYYY" range or "YYYY,YYYY,..." list. output_mode: Response format - "json" (default) or "text"
Returns: JSON or text with group statistics, Mann-Whitney U, z-score, p-value, and Cohen's d effect size
Tips for LLMs: - Use aggregate_by="voyage" for statistically independent samples - Use wind_force_min/max to condition on Beaufort force - Use maritime_did_speed_test for formal direction x period interaction - p < 0.05 indicates statistically significant difference - Cohen's d > 0.8 indicates a large effect size - Periods accept comma-separated year lists for non-contiguous years (e.g., "1720,1728,1747" for ENSO El Nino years)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| period1_years | Yes | ||
| period2_years | Yes | ||
| lat_min | No | ||
| lat_max | No | ||
| lon_min | No | ||
| lon_max | No | ||
| nationality | No | ||
| direction | No | ||
| month_start | No | ||
| month_end | No | ||
| aggregate_by | No | observation | |
| include_samples | No | ||
| min_speed_km_day | No | ||
| max_speed_km_day | No | ||
| wind_force_min | No | ||
| wind_force_max | No | ||
| exclude_years | No | ||
| output_mode | No | json |