array_aggregate
Perform aggregation operations on 1D arrays including sumproduct, weighted average, and dot product calculations for mathematical analysis.
Instructions
Perform aggregation operations on 1D arrays.
Examples:
SUMPRODUCT: operation="sumproduct", array1=[1,2,3], array2=[4,5,6] Result: 32 (1×4 + 2×5 + 3×6)
WEIGHTED AVERAGE: operation="weighted_average", array1=[10,20,30], weights=[1,2,3] Result: 23.33... ((10×1 + 20×2 + 30×3) / (1+2+3))
DOT PRODUCT: operation="dot_product", array1=[1,2], array2=[3,4] Result: 11 (1×3 + 2×4)
GRADE CALCULATION: operation="weighted_average", array1=[85,92,78], weights=[0.3,0.5,0.2] Result: 86.5
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| context | No | Optional annotation to label this calculation (e.g., 'Bond A PV', 'Q2 revenue'). Appears in results for easy identification. | |
| output_mode | No | Output format: full (default), compact, minimal, value, or final. See batch_execute tool for details. | full |
| operation | Yes | Aggregation operation | |
| array1 | Yes | First 1D array (e.g., [1,2,3]) | |
| array2 | No | Second 1D array for sumproduct/dot_product | |
| weights | No | Weights for weighted_average (e.g., [1,2,3]) |