atomica.reconciliation

Implements the automatic reconciliation algorithm

In any given model run, the parameters calculated by the ProgramSet should ideally match up with the values in the ParameterSet so that there are no discontinuities in parameter value. This may not be the case depending on the data gathered and the calibration. Reconciliation aims to adjust the internal parameters of the ProgramSet to best match a ParameterSet in a particular year.

Functions

reconcile(project, parset, progset, …[, …]) Modify a progset to optimally match a parset in a specified year
atomica.reconciliation._convert_to_single_year(progset, reconciliation_year)[source]
atomica.reconciliation._extract_targets(result, progset, ti, eval_pars=None)[source]
atomica.reconciliation._objective(x, mapping, progset, eval_years, target_vals, num_eligible, dt)[source]
atomica.reconciliation._prepare_asd_inputs(progset, bounds)[source]
atomica.reconciliation._prepare_bounds(progset, unit_cost_bounds, baseline_bounds, capacity_bounds, outcome_bounds)[source]
atomica.reconciliation._update_progset(asd_vals, mapping, progset)[source]
atomica.reconciliation.reconcile(project, parset, progset, reconciliation_year, max_time=10, unit_cost_bounds=0.0, baseline_bounds=0.0, capacity_bounds=0.0, outcome_bounds=0.0, eval_pars=None, eval_range=None)[source]

Modify a progset to optimally match a parset in a specified year

Reconciliation is a mapping from one progset to another. The output progset generates optimally matched output parameter values compared to the specified parset, in the reconciliation year for the progset’s default spending. The output progset has internal attributes (such as unit costs) with values that are defined only in the reconciliation year. So while the input progset may have time varying unit costs etc. after reconciliation, they will be constant.

The upper and lower bounds for unit costs, baseline, capacity_constraint, and outcome are specified as fractions of the initial value. For example, entering unit_cost_bounds=0.2 would mean that unit costs would be allowed to range from 0.8 to 1.2 times the value in the input progset.

Parameters:
  • project – A Project instance
  • parset – A ParameterSet instance (or name of a parset contained in the project)
  • progset – A ProgramSet instance (or name of a progset contained in the project)
  • reconciliation_year (float) – Year to perform reconciliation in
  • max_time – Optionally override the maximum execution time in ASD
  • unit_cost_bounds – Optionally specify bounds for unit costs. Default is 0.0 (unit costs will not be changed)
  • baseline_bounds – Optionally specify bounds for baseline spending. Default is 0.0 (no changes)
  • capacity_bounds – Optionally specify bounds for capacity_constraint constraints. Default is 0.0 (no changes)
  • outcome_bounds – Optionally specify bounds for outcome values. Default is 0.0 (no changes)
  • eval_pars – Optionally select a subset of parameters for comparison. By default, all parameters overwritten by the progset will be used.
  • eval_range – Optionally specify a range of years over which to evaluate the progset-parset match. By default, it will only use the reconciliation year
Returns:

tuple containing - A reconciled ProgramSet instance - A DataFrame comparing the unreconciled and reconciled progsets - A DataFrame comparing the parset parameters and progset