{"openapi":"3.1.0","info":{"title":"BOZ Research Models API","description":"OpenAPI-compliant access to processed BOZ model outputs. Free, with an API key: create one at Palladium Terminal (Account → API keys) and send it in the `X-API-Key` header (or as `api_key` in the query). Use `/docs` for Swagger UI (Authorize takes the key) and `/openapi.json` for the machine-readable spec.","contact":{"name":"BOZ Research API"},"license":{"name":"MIT"},"version":"1.0.0"},"paths":{"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Health Get"}}}}}}},"/api/v1/models":{"get":{"tags":["Models"],"summary":"List Models","operationId":"list_models_api_v1_models_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ModelInfo"},"type":"array","title":"Response List Models Api V1 Models Get"}}}}},"security":[{"APIKeyHeader":[]},{"APIKeyQuery":[]}]}},"/api/v1/models/{model_name}":{"get":{"tags":["Models"],"summary":"Get Model Data","operationId":"get_model_data_api_v1_models__model_name__get","security":[{"APIKeyHeader":[]},{"APIKeyQuery":[]}],"parameters":[{"name":"model_name","in":"path","required":true,"schema":{"type":"string","title":"Model Name"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive start date (YYYY-MM-DD).","title":"Start Date"},"description":"Inclusive start date (YYYY-MM-DD)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive end date (YYYY-MM-DD).","title":"End Date"},"description":"Inclusive end date (YYYY-MM-DD)."},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Optional max number of returned rows (the first ones in `order`).","title":"Limit"},"description":"Optional max number of returned rows (the first ones in `order`)."},{"name":"response_format","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ResponseFormat","default":"json"}},{"name":"order","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Order","description":"Row order by date: `asc` (oldest first) or `desc` (newest first, so `limit` keeps the latest rows).","default":"asc"},"description":"Row order by date: `asc` (oldest first) or `desc` (newest first, so `limit` keeps the latest rows)."},{"name":"columns","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"},"maxItems":200},{"type":"null"}],"description":"Columns to return, one parameter each (`columns=A&columns=B`; names can contain commas). The date column is always included.","title":"Columns"},"description":"Columns to return, one parameter each (`columns=A&columns=B`; names can contain commas). The date column is always included."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/mobile-money/growth":{"get":{"tags":["Mobile Money"],"summary":"Get Mobile Money Growth","operationId":"get_mobile_money_growth_api_v1_mobile_money_growth_get","security":[{"APIKeyHeader":[]},{"APIKeyQuery":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive start date (YYYY-MM-DD).","title":"Start Date"},"description":"Inclusive start date (YYYY-MM-DD)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Inclusive end date (YYYY-MM-DD).","title":"End Date"},"description":"Inclusive end date (YYYY-MM-DD)."},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"Optional max number of returned rows (the first ones in `order`).","title":"Limit"},"description":"Optional max number of returned rows (the first ones in `order`)."},{"name":"response_format","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ResponseFormat","default":"json"}},{"name":"order","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Order","description":"Row order by date: `asc` (oldest first) or `desc` (newest first, so `limit` keeps the latest rows).","default":"asc"},"description":"Row order by date: `asc` (oldest first) or `desc` (newest first, so `limit` keeps the latest rows)."},{"name":"columns","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"},"maxItems":200},{"type":"null"}],"description":"Columns to return, one parameter each (`columns=A&columns=B`; names can contain commas). The date column is always included.","title":"Columns"},"description":"Columns to return, one parameter each (`columns=A&columns=B`; names can contain commas). The date column is always included."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ml/methods":{"get":{"tags":["Machine learning"],"summary":"Ml Methods","description":"The time series methods and the options each takes, each with the endpoint that runs it,\nthen the policy lab; the naive forecast is marked as the baseline the others are scored\nagainst. Front ends count the models from this, so a method added here is counted there.","operationId":"ml_methods_api_v1_ml_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response Ml Methods Api V1 Ml Methods Get"}}}}},"security":[{"APIKeyHeader":[]},{"APIKeyQuery":[]}]}},"/api/v1/ml/forecast":{"get":{"tags":["Machine learning"],"summary":"Ml Forecast","description":"Fits a time series model to one column, backtests it and forecasts it, with intervals and diagnostics.","operationId":"ml_forecast_api_v1_ml_forecast_get","security":[{"APIKeyHeader":[]},{"APIKeyQuery":[]}],"parameters":[{"name":"model","in":"query","required":true,"schema":{"type":"string","description":"The model (dataset) to take the series from, as in GET /api/v1/models.","title":"Model"},"description":"The model (dataset) to take the series from, as in GET /api/v1/models."},{"name":"column","in":"query","required":true,"schema":{"type":"string","description":"The numeric column to model.","title":"Column"},"description":"The numeric column to model."},{"name":"method","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MLMethod","description":"arima, ets, theta, garch, lstm, mlp, nbeats, kan, gp, gbm, var, bvar, nowcast, ensemble, bandit, markov, uc or naive.","default":"arima"},"description":"arima, ets, theta, garch, lstm, mlp, nbeats, kan, gp, gbm, var, bvar, nowcast, ensemble, bandit, markov, uc or naive."},{"name":"horizon","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":1,"description":"Periods to forecast.","default":12,"title":"Horizon"},"description":"Periods to forecast."},{"name":"test","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":0,"description":"Latest periods held back to score a fit on the rest (0: no backtest).","default":12,"title":"Test"},"description":"Latest periods held back to score a fit on the rest (0: no backtest)."},{"name":"freq","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Resample","description":"`native` keeps the series' own dates; `W`, `M` or `Q` resample it to weeks, months or quarters.","default":"native"},"description":"`native` keeps the series' own dates; `W`, `M` or `Q` resample it to weeks, months or quarters."},{"name":"agg","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Aggregate","description":"How resampling combines values in a period: the last, the mean or the sum.","default":"last"},"description":"How resampling combines values in a period: the last, the mean or the sum."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Use the series from this date (YYYY-MM-DD).","title":"Start Date"},"description":"Use the series from this date (YYYY-MM-DD)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Use the series up to this date (YYYY-MM-DD).","title":"End Date"},"description":"Use the series up to this date (YYYY-MM-DD)."},{"name":"transform","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Transform","description":"ARIMA, ETS, Theta, LSTM, MLP, N-BEATS, KAN, Gaussian process, boosted trees, structural: model the log of the series (all values must be above zero).","default":"none"},"description":"ARIMA, ETS, Theta, LSTM, MLP, N-BEATS, KAN, Gaussian process, boosted trees, structural: model the log of the series (all values must be above zero)."},{"name":"intervals","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Intervals","description":"`calibrated` rescales the 80% and 95% bands so they cover what they claim on the method's own past errors (refitted at up to 6 points before the test window; split conformal). Takes about six more fits. Not the adaptive ensemble.","default":"model"},"description":"`calibrated` rescales the 80% and 95% bands so they cover what they claim on the method's own past errors (refitted at up to 6 points before the test window; split conformal). Takes about six more fits. Not the adaptive ensemble."},{"name":"theta","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":10,"minimum":1},{"type":"null"}],"description":"Theta: the theta line (2: the classic method; left out: chosen with the smoothing weight by in-sample error).","title":"Theta"},"description":"Theta: the theta line (2: the classic method; left out: chosen with the smoothing weight by in-sample error)."},{"name":"tightness","in":"query","required":false,"schema":{"anyOf":[{"type":"number","maximum":5,"exclusiveMinimum":0},{"type":"null"}],"description":"Bayesian VAR: the prior's overall tightness (smaller shrinks harder; left out: chosen by marginal likelihood).","title":"Tightness"},"description":"Bayesian VAR: the prior's overall tightness (smaller shrinks harder; left out: chosen by marginal likelihood)."},{"name":"scenario","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Bayesian VAR: model:column:pct, one of the with= series moved in a straight line to pct% above (or below, negative) its last value by the horizon's end; the others are forecast conditional on it. One parameter each.","title":"Scenario"},"description":"Bayesian VAR: model:column:pct, one of the with= series moved in a straight line to pct% above (or below, negative) its last value by the horizon's end; the others are forecast conditional on it. One parameter each."},{"name":"factors","in":"query","required":false,"schema":{"type":"integer","maximum":3,"minimum":1,"description":"Nowcast: common factors taken from the indicators.","default":2,"title":"Factors"},"description":"Nowcast: common factors taken from the indicators."},{"name":"p","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":5,"minimum":0},{"type":"null"}],"description":"ARIMA: autoregressive order (with d and q; all three left out chooses automatically).","title":"P"},"description":"ARIMA: autoregressive order (with d and q; all three left out chooses automatically)."},{"name":"d","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":2,"minimum":0},{"type":"null"}],"description":"ARIMA: differences.","title":"D"},"description":"ARIMA: differences."},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":5,"minimum":0},{"type":"null"}],"description":"ARIMA: moving average order.","title":"Q"},"description":"ARIMA: moving average order."},{"name":"vol","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Volatility","description":"GARCH: the variance model.","default":"GARCH"},"description":"GARCH: the variance model."},{"name":"garch_p","in":"query","required":false,"schema":{"type":"integer","maximum":3,"minimum":1,"description":"GARCH: lags of squared shocks.","default":1,"title":"Garch P"},"description":"GARCH: lags of squared shocks."},{"name":"garch_q","in":"query","required":false,"schema":{"type":"integer","maximum":3,"minimum":0,"description":"GARCH: lags of variance.","default":1,"title":"Garch Q"},"description":"GARCH: lags of variance."},{"name":"dist","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Distribution","description":"GARCH: error distribution.","default":"normal"},"description":"GARCH: error distribution."},{"name":"mean","in":"query","required":false,"schema":{"$ref":"#/components/schemas/MeanModel","description":"GARCH: mean model of the returns.","default":"constant"},"description":"GARCH: mean model of the returns."},{"name":"returns","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Returns","description":"GARCH: log returns (in %) or plain changes; auto picks log returns for a positive series. Markov: also `level`; auto models changes only when the series trends.","default":"auto"},"description":"GARCH: log returns (in %) or plain changes; auto picks log returns for a positive series. Markov: also `level`; auto models changes only when the series trends."},{"name":"lookback","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":120,"minimum":2},{"type":"null"}],"description":"LSTM, MLP, N-BEATS, KAN, boosted trees: past periods each prediction sees (default by frequency; N-BEATS and KAN: at least the horizon).","title":"Lookback"},"description":"LSTM, MLP, N-BEATS, KAN, boosted trees: past periods each prediction sees (default by frequency; N-BEATS and KAN: at least the horizon)."},{"name":"units","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":64,"minimum":4},{"type":"null"}],"description":"LSTM, MLP: hidden units (default 16). N-BEATS: units in each layer (default 32). KAN: hidden nodes (default 8).","title":"Units"},"description":"LSTM, MLP: hidden units (default 16). N-BEATS: units in each layer (default 32). KAN: hidden nodes (default 8)."},{"name":"epochs","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":20},{"type":"null"}],"description":"LSTM, MLP, N-BEATS, KAN: most training passes (default 300; N-BEATS and KAN 400; training stops early when validation stops improving).","title":"Epochs"},"description":"LSTM, MLP, N-BEATS, KAN: most training passes (default 300; N-BEATS and KAN 400; training stops early when validation stops improving)."},{"name":"seeds","in":"query","required":false,"schema":{"type":"integer","maximum":5,"minimum":1,"description":"LSTM, MLP, N-BEATS, KAN: networks trained and averaged.","default":3,"title":"Seeds"},"description":"LSTM, MLP, N-BEATS, KAN: networks trained and averaged."},{"name":"grid","in":"query","required":false,"schema":{"type":"integer","maximum":20,"minimum":3,"description":"KAN: intervals in each edge's B-spline grid.","default":10,"title":"Grid"},"description":"KAN: intervals in each edge's B-spline grid."},{"name":"stacks","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Stacks","description":"N-BEATS: trend and seasonality stacks (and a generic block), whose parts of the forecast are returned, or generic blocks only.","default":"interpretable"},"description":"N-BEATS: trend and seasonality stacks (and a generic block), whose parts of the forecast are returned, or generic blocks only."},{"name":"error","in":"query","required":false,"schema":{"$ref":"#/components/schemas/EtsError","description":"ETS: additive or multiplicative errors (auto: chosen by AICc).","default":"auto"},"description":"ETS: additive or multiplicative errors (auto: chosen by AICc)."},{"name":"trend","in":"query","required":false,"schema":{"$ref":"#/components/schemas/EtsTrend","description":"ETS: no trend, additive or damped (auto: chosen by AICc).","default":"auto"},"description":"ETS: no trend, additive or damped (auto: chosen by AICc)."},{"name":"seasonal","in":"query","required":false,"schema":{"$ref":"#/components/schemas/EtsSeason","description":"ETS: no season, additive or multiplicative (auto: chosen by AICc; needs two years and a bit). Structural: none leaves the season out; add or mul require it.","default":"auto"},"description":"ETS: no season, additive or multiplicative (auto: chosen by AICc; needs two years and a bit). Structural: none leaves the season out; add or mul require it."},{"name":"with","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"VAR and Bayesian VAR (1–4 needed), nowcast (2–8 indicators, taken monthly), boosted trees and structural (optional): other series as model:column, one parameter each. Series on different dates are resampled to the coarsest frequency (a nowcast's indicators stay monthly).","title":"With"},"description":"VAR and Bayesian VAR (1–4 needed), nowcast (2–8 indicators, taken monthly), boosted trees and structural (optional): other series as model:column, one parameter each. Series on different dates are resampled to the coarsest frequency (a nowcast's indicators stay monthly)."},{"name":"lags","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":24,"minimum":1},{"type":"null"}],"description":"VAR: lags (left out: chosen by the criterion `ic`, on the training part). Bayesian VAR: lags (left out: 6 a month, 4 a quarter).","title":"Lags"},"description":"VAR: lags (left out: chosen by the criterion `ic`, on the training part). Bayesian VAR: lags (left out: 6 a month, 4 a quarter)."},{"name":"ic","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Criterion","description":"VAR: the criterion that chooses the lags.","default":"aic"},"description":"VAR: the criterion that chooses the lags."},{"name":"members","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MLMethod"}},{"type":"null"}],"description":"Ensemble, adaptive ensemble: the methods combined, one parameter each (ensemble: arima, ets, mlp, gbm and naive when left out; adaptive: ets, nbeats, kan and naive).","title":"Members"},"description":"Ensemble, adaptive ensemble: the methods combined, one parameter each (ensemble: arima, ets, mlp, gbm and naive when left out; adaptive: ets, nbeats, kan and naive)."},{"name":"window","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":240,"minimum":8},{"type":"null"}],"description":"Adaptive ensemble: the periods it learns its weights over (default: 36 months, or twice the horizon; at most a third of the series).","title":"Window"},"description":"Adaptive ensemble: the periods it learns its weights over (default: 36 months, or twice the horizon; at most a third of the series)."},{"name":"eta","in":"query","required":false,"schema":{"type":"number","maximum":10,"exclusiveMinimum":0,"description":"Adaptive ensemble: learning rate; higher moves weight faster towards whichever members did well last.","default":0.3,"title":"Eta"},"description":"Adaptive ensemble: learning rate; higher moves weight faster towards whichever members did well last."},{"name":"share","in":"query","required":false,"schema":{"type":"number","maximum":0.5,"minimum":0,"description":"Adaptive ensemble: share of the weight spread evenly each period, so a member that fell behind can win weight back.","default":0.05,"title":"Share"},"description":"Adaptive ensemble: share of the weight spread evenly each period, so a member that fell behind can win weight back."},{"name":"combine","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Combine","description":"Ensemble: weights by validation error, or the median or mean.","default":"weights"},"description":"Ensemble: weights by validation error, or the median or mean."},{"name":"regimes","in":"query","required":false,"schema":{"type":"integer","maximum":3,"minimum":2,"description":"Markov: how many regimes.","default":2,"title":"Regimes"},"description":"Markov: how many regimes."},{"name":"switch","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Switching","description":"Markov: what changes between regimes: the mean, the volatility or both.","default":"both"},"description":"Markov: what changes between regimes: the mean, the volatility or both."},{"name":"ar","in":"query","required":false,"schema":{"type":"integer","maximum":2,"minimum":0,"description":"Markov: autoregressive lags (not switching).","default":0,"title":"Ar"},"description":"Markov: autoregressive lags (not switching)."},{"name":"trend_model","in":"query","required":false,"schema":{"$ref":"#/components/schemas/TrendModel","description":"Structural: local level, smooth trend, local linear trend or random walk with drift (auto: by AIC).","default":"auto"},"description":"Structural: local level, smooth trend, local linear trend or random walk with drift (auto: by AIC)."},{"name":"cycle","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Cycle","description":"Structural: a damped stochastic cycle (auto: with 40 or more observations).","default":"auto"},"description":"Structural: a damped stochastic cycle (auto: with 40 or more observations)."},{"name":"events","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Structural: interventions, YYYY-MM-DD for a step or YYYY-MM-DD:pulse for a one-off, one parameter each (up to 5).","title":"Events"},"description":"Structural: interventions, YYYY-MM-DD for a step or YYYY-MM-DD:pulse for a one-off, one parameter each (up to 5)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ml Forecast Api V1 Ml Forecast Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ml/compare":{"get":{"tags":["Machine learning"],"summary":"Ml Compare","description":"Every method (or those chosen) on one column with default settings, ranked by backtest RMSE.","operationId":"ml_compare_api_v1_ml_compare_get","security":[{"APIKeyHeader":[]},{"APIKeyQuery":[]}],"parameters":[{"name":"model","in":"query","required":true,"schema":{"type":"string","description":"The model (dataset) to take the series from, as in GET /api/v1/models.","title":"Model"},"description":"The model (dataset) to take the series from, as in GET /api/v1/models."},{"name":"column","in":"query","required":true,"schema":{"type":"string","description":"The numeric column to model.","title":"Column"},"description":"The numeric column to model."},{"name":"methods","in":"query","required":false,"schema":{"anyOf":[{"type":"array","items":{"$ref":"#/components/schemas/MLMethod"}},{"type":"null"}],"description":"Methods to compare, one parameter each (all thirteen that model a series on their own when left out: arima, ets, theta, garch, lstm, mlp, nbeats, kan, gp, gbm, markov, uc and naive; bandit, the adaptive ensemble, can be added and is ranked like them, though it takes 10-20 s; not var, bvar, nowcast or ensemble).","title":"Methods"},"description":"Methods to compare, one parameter each (all thirteen that model a series on their own when left out: arima, ets, theta, garch, lstm, mlp, nbeats, kan, gp, gbm, markov, uc and naive; bandit, the adaptive ensemble, can be added and is ranked like them, though it takes 10-20 s; not var, bvar, nowcast or ensemble)."},{"name":"horizon","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":1,"description":"Periods to forecast.","default":12,"title":"Horizon"},"description":"Periods to forecast."},{"name":"test","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":1,"description":"Latest periods held back to score each method.","default":12,"title":"Test"},"description":"Latest periods held back to score each method."},{"name":"freq","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Resample","description":"`native` keeps the series' own dates; `W`, `M` or `Q` resample it to weeks, months or quarters.","default":"native"},"description":"`native` keeps the series' own dates; `W`, `M` or `Q` resample it to weeks, months or quarters."},{"name":"agg","in":"query","required":false,"schema":{"$ref":"#/components/schemas/Aggregate","description":"How resampling combines values in a period: the last, the mean or the sum.","default":"last"},"description":"How resampling combines values in a period: the last, the mean or the sum."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Use the series from this date (YYYY-MM-DD).","title":"Start Date"},"description":"Use the series from this date (YYYY-MM-DD)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Use the series up to this date (YYYY-MM-DD).","title":"End Date"},"description":"Use the series up to this date (YYYY-MM-DD)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ml Compare Api V1 Ml Compare Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/ml/policy":{"get":{"tags":["Machine learning"],"summary":"Ml Policy","description":"A reinforcement-learning agent sets the policy rate in an economy estimated from inflation, the\nkwacha and the policy rate (monthly), against the optimal linear rule, a smoothed Taylor rule and\nholding the rate: their rules, simulated paths from now, losses and the agent's training.","operationId":"ml_policy_api_v1_ml_policy_get","security":[{"APIKeyHeader":[]},{"APIKeyQuery":[]}],"parameters":[{"name":"target","in":"query","required":false,"schema":{"type":"number","maximum":30,"minimum":0,"description":"Inflation target, % (the Bank of Zambia's band is 6–8%: its midpoint).","default":7.0,"title":"Target"},"description":"Inflation target, % (the Bank of Zambia's band is 6–8%: its midpoint)."},{"name":"w_inflation","in":"query","required":false,"schema":{"type":"number","maximum":10,"minimum":0,"description":"Weight on inflation's squared gap from target in each month's loss.","default":1.0,"title":"W Inflation"},"description":"Weight on inflation's squared gap from target in each month's loss."},{"name":"w_rate","in":"query","required":false,"schema":{"type":"number","maximum":10,"minimum":0,"description":"Weight on the squared change in the policy rate (moving it is costly).","default":0.5,"title":"W Rate"},"description":"Weight on the squared change in the policy rate (moving it is costly)."},{"name":"w_kwacha","in":"query","required":false,"schema":{"type":"number","maximum":10,"minimum":0,"description":"Weight on the kwacha's squared monthly depreciation, %.","default":0.1,"title":"W Kwacha"},"description":"Weight on the kwacha's squared monthly depreciation, %."},{"name":"horizon","in":"query","required":false,"schema":{"type":"integer","maximum":120,"minimum":12,"description":"Months simulated from now for each policy's paths.","default":36,"title":"Horizon"},"description":"Months simulated from now for each policy's paths."},{"name":"lags","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":3,"minimum":1},{"type":"null"}],"description":"Lags in the economy model (left out: chosen by AIC).","title":"Lags"},"description":"Lags in the economy model (left out: chosen by AIC)."},{"name":"iterations","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":20,"description":"The agent's training iterations (each: 64 nudged rules on 48 simulated 5-year episodes).","default":300,"title":"Iterations"},"description":"The agent's training iterations (each: 64 nudged rules on 48 simulated 5-year episodes)."},{"name":"discount","in":"query","required":false,"schema":{"type":"number","maximum":0.999,"minimum":0.8,"description":"Monthly discount on future losses.","default":0.98,"title":"Discount"},"description":"Monthly discount on future losses."},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Estimate the economy from this date (YYYY-MM-DD).","title":"Start Date"},"description":"Estimate the economy from this date (YYYY-MM-DD)."},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Estimate the economy up to this date (YYYY-MM-DD); the paths start from its last month.","title":"End Date"},"description":"Estimate the economy up to this date (YYYY-MM-DD); the paths start from its last month."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Ml Policy Api V1 Ml Policy Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"Aggregate":{"type":"string","enum":["last","mean","sum"],"title":"Aggregate"},"Combine":{"type":"string","enum":["weights","median","mean"],"title":"Combine"},"Criterion":{"type":"string","enum":["aic","bic","hqic"],"title":"Criterion"},"Cycle":{"type":"string","enum":["auto","on","off"],"title":"Cycle"},"Distribution":{"type":"string","enum":["normal","t","skewt"],"title":"Distribution"},"EtsError":{"type":"string","enum":["auto","add","mul"],"title":"EtsError"},"EtsSeason":{"type":"string","enum":["auto","none","add","mul"],"title":"EtsSeason"},"EtsTrend":{"type":"string","enum":["auto","none","add","damped"],"title":"EtsTrend"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Intervals":{"type":"string","enum":["model","calibrated"],"title":"Intervals"},"MLMethod":{"type":"string","enum":["arima","ets","theta","garch","lstm","mlp","nbeats","kan","gp","gbm","var","bvar","nowcast","ensemble","bandit","markov","uc","naive"],"title":"MLMethod"},"MeanModel":{"type":"string","enum":["constant","zero","ar"],"title":"MeanModel"},"ModelInfo":{"properties":{"model_name":{"type":"string","title":"Model Name","description":"Canonical model key to use in API calls."},"file_path":{"type":"string","title":"File Path","description":"CSV filename backing this model."},"date_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Column","description":"Detected date column if available."},"rows":{"type":"integer","title":"Rows","description":"Total available rows."},"columns":{"items":{"type":"string"},"type":"array","title":"Columns","description":"Column names in the dataset."}},"type":"object","required":["model_name","file_path","rows","columns"],"title":"ModelInfo"},"ModelResponse":{"properties":{"model_name":{"type":"string","title":"Model Name"},"date_column":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date Column"},"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"count":{"type":"integer","title":"Count"},"data":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Data"}},"type":"object","required":["model_name","date_column","start_date","end_date","count","data"],"title":"ModelResponse"},"Order":{"type":"string","enum":["asc","desc"],"title":"Order"},"Resample":{"type":"string","enum":["native","W","M","Q"],"title":"Resample"},"ResponseFormat":{"type":"string","enum":["json","csv"],"title":"ResponseFormat"},"Returns":{"type":"string","enum":["auto","log","diff","level"],"title":"Returns"},"Stacks":{"type":"string","enum":["interpretable","generic"],"title":"Stacks"},"Switching":{"type":"string","enum":["both","mean","variance"],"title":"Switching"},"Transform":{"type":"string","enum":["none","log"],"title":"Transform"},"TrendModel":{"type":"string","enum":["auto","level","smooth","llt","rwdrift"],"title":"TrendModel"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Volatility":{"type":"string","enum":["GARCH","EGARCH","GJR"],"title":"Volatility"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","description":"Your API key (create one free at /account).","in":"header","name":"X-API-Key"},"APIKeyQuery":{"type":"apiKey","description":"The API key as a query parameter, for tools that can't set headers.","in":"query","name":"api_key"}}}}