gcubed.benchmarking.comparator
This module contains the Comparator
class that compares two
Benchmarks
instances.
Overview
Create a set of benchmark results associated with a model and a version of Ox.
Overview
Analyses and reports on differences between the original and new benchmarks.
Arguments
old_benchmarks
: The old benchmarks. Typically these have been run some time
ago and are pickled (serialised to disk) and will need to be unpickled (restored
to a Python object) before being passed to this Comparator for analysis.
new_benchmarks
: The new benchmarks. Often these benchmarks are run and used
immediately.
The absolute allowable errors. See numpy.allclose
for details.
Defaults to 0.00001
.
The relative allowable errors. See numpy.allclose
for details.
Defaults to 0.00001
.
The discrepancy limit, used for determining which discrepancies to report.
Defaults to 0.00001
.
Arguments
old: The data frame of numbers from the old benchmarks.
new: The data frame of numbers from the new benchmarks.
Returns
A boolean array where two arrays are element-wise equal within the
absolute and relative tolerances set for this Comparator
.
Exceptions
Raises an exception if the two arrays are not the same shape.
Arguments
old: The data frame of numbers from the old benchmarks.
new: The data frame of numbers from the new benchmarks.
Returns
True
if arrays are element-wise equal within the
absolute and relative tolerances set for this Comparator
.
Exceptions
Raises an exception if the two arrays are not the same shape.
Overview
Compare two vectors.
Arguments
name: The name of the vector being compared.
old: The old vector
new: The new vector
old_name: The name of the old vector
new_name: The name of the new vector
Returns
True
if the values in the vectors match.
Overview
Compare two matrices.
Arguments
name: The name of the matrix being compared.
old: The old matrix
new: The new matrix
new_name: The name of the new matrix
old_name: The name of the old matrix
Returns
True
if the values in the matrices match.
Overview
Match the content in the SYM summaries of the model variables.
Checks to run:
- The list of variables are the same.
Returns
True
if the new and old benchmarks match.
Overview
Ensure that there is exactly 1 new parameter for each old parameter and visa-versa.
Ensure that each parameter value is associated with the same parameter name and order and set members. and that the parameter values are identical (to within a reasonable level of numerical accuracy).
Overview
Compare RHS vector values used in initial model linearisation.
Overview
Compare old and new LHS vector values calculated using the non-linear equations as part of model linearisation.
Overview
Compare partial derivatives matrices for the model linearisation.
Overview
Compare state space form matrices computed from the linearised model partial derivative matrices.
Compare effective labour productivity adjustments to exogenous projections.
Benchmarks the potential output growth adjustments to exogenous projections.
Compare sectoral energy usage efficiency gain projections.
Benchmarks the consumption energy usage efficiency gain projections.
Benchmarks the first year observed values of variables adjusted_by intertemporal constants.
Benchmarks the first year original projections of variables adjusted by intertemporal constants.
Benchmarks the first projection year state space form evaluations of the LHS vectors.
Benchmarks the first projection year data difference from state space form evaluations of the LHS vectors.
Benchmarks the partial derivatives matrix used to compute intertemporal constants.
Benchmarks the baseline exogenous variable projections.
Benchmarks the first projection year original (unadjusted by constants) projections of the LHS vectors.