Compare series and cross-validate
compare_seriesCompare 2-6 economic series across economies, institutions, or concepts by aligning them to one frequency. Get correlations, provenance, and validation in a single output.
Instructions
Align 2-6 series to one frequency and compare them: across economies, institutions or concepts.
Examples:
- economies: [{"indicator":"POLICY_RATE","country":"US"}, {"indicator":"POLICY_RATE","country":"EA"}]
- institutions: [{"indicator":"CPI","country":"CN","source":"IMF"}, {"indicator":"CPI","country":"CN","source":"BIS"}]
→ the same concept and economy from different institutions adds cross_validation automatically
- concepts: [{"indicator":"POLICY_RATE","country":"GB"}, {"indicator":"CPI_YOY","country":"GB"}]
Args:
series: list of series (indicator/country/source, or stat_code/..., or source/dataflow/key/cycle)
start_date: start period (default: the last recent_years years)
end_date: end period
recent_years: window (default 3)
frequency: comparison frequency (default: the lowest one)
aggregation: "mean" | "last" | "first" | "sum" (default per concept: flows such as the current account
or GDP are summed, stocks such as reserves take the period end, everything else is averaged)
normalize_method: "none" | "index" (first period = 100) | "zscore"
join: "inner" | "outer"
output_format: "compact" | "csv"
Returns:
the aligned table, correlations, provenance and validation per series, and cross-validation where it applies
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| join | No | inner | |
| series | Yes | ||
| end_date | No | ||
| frequency | No | ||
| start_date | No | ||
| aggregation | No | ||
| recent_years | No | ||
| output_format | No | compact | |
| normalize_method | No | none |