Annual forecasts of observed bilateral totals or allocated commodity proxies, one to eight years ahead, with a cross-validation-based uncertainty band.
Surface: /forecast
BACI 202601 (CEPII), HS96, 1996-2024 (retrieved 2026-06-01)
The forecast combines Holt's linear trend method, OLS linear regression, and a weighted moving average with drift.
Holt smoothing parameters are selected by a grid search that minimises in-sample mean squared error. The moving average uses up to the latest five observations with linearly increasing weights and a similarly weighted annual drift.
Each model's ensemble weight is proportional to inverse leave-last-out cross-validation MSE, using at most five folds. If any models have exactly zero MSE, they share all weight equally. Equal weights across all models are used when cross-validation cannot determine weights. Negative ensemble forecasts are clamped to zero.
The uncertainty band uses the ensemble's pooled leave-last-out residual error, with fold-local weights recomputed so held-out observations do not enter their own forecast weights. The margin grows with the square root of the forecast horizon.
Total-trade forecasts read the bilateral total directly. Commodity forecasts approximate bilateral commodity trade as the bilateral total multiplied by the exporter's share of exports in the selected HS chapter group. BACI values are converted from thousands of USD to plain USD before modelling.
For positive finite MSE: weight(m) ∝ 1 / MSE(m). If any MSE = 0, only zero-error models share equal weight.forecast(k) = max(0, sum_m weight(m) * forecast(m,k))WMA = sum_i i * value(i) / sum_i iOLS_value(year) = intercept + slope * yearband(k) = forecast(k) +/- 1.96 * residual_SE * sqrt(k)| Path | Method | Returns | Example |
|---|---|---|---|
| /api/prediction/forecast | POST | Historical values in USD with an explicit observed-bilateral or allocated-commodity basis and method description, forecast periods and values, bands, model weights and backtest diagnostics. Charts and CSV exports preserve the historical basis. | Not linkable |