gcubed.reporting.structural_equation_residuals
Report nonlinear structural-equation discrepancies at linearisation points.
EQUATION_FAMILIES: dict[str, tuple[str, ...]] =
{'capital rental price and user cost': ('PRII', 'PRK', 'PRKY', 'PRKZ'), 'capital q and adjustment cost': ('TOB', 'TOBY', 'TOBZ', 'TPA', 'TPAY', 'TPAZ'), 'investment demand and capital accumulation': ('INV', 'INVY', 'INVZ', 'JNV', 'JNVY', 'JNVZ', 'CAP', 'CAPY', 'CAPZ', 'INVP', 'INVT'), 'capital costate': ('LAM', 'LAMY', 'LAMZ'), 'wage': ('WAGE', 'WAG', 'WAGG', 'WAGR'), 'labour': ('LAB', 'LABO', 'IITL', 'CNPL'), 'price and growth expectations': ('EPRC', 'EYGR', 'INFL', 'INFCL', 'INFP'), 'monetary policy': ('INTN', 'INTL')}
def
structural_equation_residual_report( linear_model: gcubed.linearisation.linear_model.LinearModel, linearisation_database: gcubed.data.linearisation_database.LinearisationDatabase, *, regions: Iterable[str] = ('LKA', 'VNM')) -> pandas.DataFrame:
Evaluate selected generated equations at observed and neutral points.
Each equation has an exact summary row. Term rows split only the generated equation's top-level additions and subtractions. Products, ratios, logs, and nested sums remain atomic terms, so the decomposition is exact without inventing a non-unique split of nonlinear expressions.
def
write_structural_equation_residual_report( linear_model: gcubed.linearisation.linear_model.LinearModel, linearisation_database: gcubed.data.linearisation_database.LinearisationDatabase) -> pandas.DataFrame:
Write and return the standard structural-equation residual report.