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, year=2024, call_tc=False, baseline_policy=None, iit_reform=None, data='cps', gfactors=None, weights=None, records_start_year=2011)[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, gfactors=None, weights=None, records_start_year=2011)[source]#
ParametersBase reads JSON file and sets attributes to self Next call self.compute_default_params for further initialization
- Parameters:
test (bool) – whether to run in test mode
year (int) – start year for simulation
call_tc (bool) – whether to use Tax-Calculator to estimate marginal tax rates
baseline_policy (dict) – individual income tax baseline policy parameters, reform dict makes changes relative to this baseline
iit_reform (dict) – individual income tax reform parameters
data (str) – data source for Tax-Calculator
gfactors (dict) – growth factors for Tax-Calculator
weights (str) – weights for Tax-Calculator
- Returns:
None
- 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}, }