Parameters#

parameters

ccc.parameters#

ccc.parameters.revision_warnings_errors(spec_revision)[source]#

Return warnings and errors for the specified Cost-of-Capital-Calculator Specificaton revision in parameter values.

Parameters:

spec_revision (dict) – dictionary suitable for use with the Specification.update_specification method.

Returns:

dicionary containing any warning or error messages

Return type:

rtn_dict (dict)

class ccc.parameters.Specification(test=False, baseline=False, year=2024, call_tc=False, iit_reform={}, data='cps')[source]#

Specification class, contains model parameters. Inherits ParamTools Parameters abstract base class.

static _read_json_revision(obj)[source]#

Return a revision dictionary, which is suitable for use with the update_specification method, that is derived from the specified JSON object, which can be None or a string containing a local filename, a URL beginning with ‘http’ pointing to a JSON file hosted online, or a valid JSON text.

ccc_initialize(call_tc=False)[source]#

ParametersBase reads JSON file and sets attributes to self Next call self.compute_default_params for further initialization

Parameters:

call_tc (bool) – whether to use Tax-Calculator to estimate marginal tax rates

Returns:

None

compute_default_params()[source]#

Does cheap calculations to return parameter values

default_parameters()[source]#

Return Specification object same as self except it contains default values of all the parameters.

Returns:

Specification instance with

the default parameter values

Return type:

dps (CCC Specification object)

update_specification(revision, raise_errors=True)[source]#

Updates parameter specification with values in revision dictionary.

Parameters:
  • revision (dict) – dictionary or JSON string with one or more PARAM: YEAR-VALUE-DICTIONARY pairs

  • raise_errors (boolean) –

    if True (the default), raises ValueError when

    parameter_errors exists;

    if False, does not raise ValueError when

    parameter_errors exists and leaves error handling to caller of the update_specification method.

Returns:

None

Raises:

ValueError – if raise_errors is True AND _validate_parameter_names_types generates errors OR _validate_parameter_values generates errors.

Notes

Given a revision dictionary, typical usage of the
Specification class is as follows::
>>> spec = Specification()
>>> spec.update_specification(revision)
An example of a multi-parameter revision dictionary is as follows::
>>> revison = {
    'CIT_rate': {2021: [0.25]},
    'BonusDeprec_3yr': {2021: 0.60},
    }
class ccc.parameters.DepreciationParams(initial_state: dict | None = None, index_rates: dict | None = None, sort_values: bool = True, **ops)[source]#

Depreciation parameters class, contains model depreciation parameters. Inherits ParamTools Parameters abstract base class.