Forecast (naive, with prediction intervals)
forecastProjects displacement metrics 1–5 years ahead from 10 years of data with 80% and 95% OLS intervals, detects structural breaks, and returns optional charts. Not an official planning figure.
Instructions
Naive linear projection of a displacement metric 1–5 years ahead, based on the last 10 years, with 80% and 95% OLS prediction intervals. Structural breaks in the history are detected and reported; since_break=true fits only the data after the latest break. Optional chart (svg / chartjs / vega-lite) with the interval band. This is a statistical extrapolation, NOT a UNHCR planning figure — always present it with that caveat.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| role | No | "asylum" = people hosted IN the country; "origin" = people displaced FROM the country | |
| chart | No | Also return a chart of observed + projected values with the interval band | |
| locale | No | Language of the human-readable text output: "en" (default) or "ar" (Modern Standard Arabic, right-to-left). Structured JSON fields, ISO3 codes and dataset ids stay in English either way. | |
| metric | No | Metric to project (default refugees) | |
| country | Yes | Country name or ISO3 code, e.g. "Egypt", "EGY", "syria" | |
| since_break | No | Fit only the years since the latest detected structural break (needs ≥3 years after it). Default false. | |
| years_ahead | No | Horizon (default 3) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chart | No | ||
| caveat | Yes | ||
| fit_to | Yes | ||
| method | Yes | ||
| metric | Yes | ||
| country | Yes | ||
| fit_from | Yes | ||
| intervals | Yes | ||
| projected | Yes | ||
| historical | Yes | ||
| changepoints | Yes | ||
| country_code | Yes |