macrostat.models.IOPC#

Macro Veronese Passarella’s 3IO-PC model

The macrostat.models.IOPC module consists of the following classes

IOPC(parameters, variables, scenarios, ...)

IOPC model class for Marco Veronese Pasarella's 3IO-PC model

BehaviorIOPC([parameters, scenarios, ...])

Behavior class for Marco Veronese Passarella's 3IO-PC model

ParametersIOPC([parameters, ...])

Parameters class for the Godley-Lavoie 2006 PC model.

ScenariosIOPC([scenario_info, parameters])

Scenarios class for Marco Veronese Passarella's 3IO-PC model

VariablesIOPC([variable_info, timeseries, ...])

Variables class for Marco Veronese Passarella's 3IO-PC model

class macrostat.models.IOPC.BehaviorIOPC(parameters: ParametersIOPC | None = None, scenarios: ScenariosIOPC | None = None, variables: VariablesIOPC | None = None, scenario: int = 0, debug: bool = False)[source]#

Bases: Behavior

Behavior class for Marco Veronese Passarella’s 3IO-PC model

central_bank_bill_holdings(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the central bank bill holdings.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} B_{CB}(t) = B_{s}(t) - B_{h}(t) \end{align}

Dependency

  • state: GovernmentBillStock

  • state: HouseholdBillStock

Sets

  • CentralBankBillStock

central_bank_money_stock(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the central bank money stock.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} H_{s}(t) = H_{s}(t-1) + (B_{CB}(t) - B_{CB}(t-1)) \end{align}

Dependency

  • state: CentralBankBillStock

  • prior: CentralBankMoneyStock

  • prior: CentralBankBillStock

Sets

  • CentralBankMoneyStock

central_bank_profits(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the central bank profits (income on bills held).

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} r(t-1)B_{CB}(t-1) \end{align}

Dependency

  • prior: InterestRate

  • prior: CentralBankBillStock

Sets

  • CentralBankProfits

consumption(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the consumption.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} c(t) = \alpha_1 \left(\frac{YD^e(t)}{p_c(t)} - \pi(t)\right) + \alpha_2 \frac{V(t-1)}{p_c(t)} \end{align}

Dependency

  • state: PropensityToConsumeIncome

  • state: ExpectedDisposableIncome

  • state: ConsumerPriceIndex

  • state: ConsumerPriceInflation

  • prior: Wealth

  • params: PropensityToConsumeSavings

Sets

  • RealConsumptionHousehold

consumption_government(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the consumption of the government. This is given exogenously by the scenario.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Dependency

  • scenario: ConsumptionGovernment

Sets

  • RealConsumptionGovernment

disposable_income(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the disposable income.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} YD(t) = Y(t) - T(t) + r(t-1)B_h(t-1) \end{align}

Dependency

  • state: NationalIncome

  • state: Taxes

  • state: InterestEarnedOnBillsHousehold

Sets

  • DisposableIncome

expected_disposable_income(t: tensor, scenario: dict, params: dict | None = None)[source]#

The expected disposable income is simply the prior period’s disposable income. Equation (3.20) in the book.

Parameters:
  • t (torch.tensor) – Current time step

  • scenario (dict)

Equations

\[YD^e(t) = YD(t-1)\]

Dependency

  • prior: DisposableIncome

Sets

  • ExpectedDisposableIncome

expected_wealth(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the expected wealth.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} V^e(t) = V(t-1) + YD^e(t) - C(t) \end{align}

Dependency

  • state: ExpectedDisposableIncome

  • state: RealConsumptionHousehold

  • state: ConsumerPriceIndex

  • prior: Wealth

Sets

  • ExpectedWealth

final_demand(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the final demand as the sum of household and government demands spread over the sectors

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} d_i(t) = \beta_{HH,i}C_{HH}(t) + \beta_{GOV,i}G(t) \end{align}

Dependency

  • state: RealConsumptionHousehold

  • state: RealConsumptionGovernment

  • params: HouseholdBudgetShare

  • params: GovernmentBudgetShare

Sets

  • RealFinalDemand

government_bill_issuance(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the government bill issuance.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} B_s(t) = B_s(t-1) + (G(t) - r(t-1)B_s(t-1)) - (T(t) + r(t-1)B_{CB}(t-1)) \end{align}

Dependency

  • prior: InterestRate

  • prior: GovernmentBillStock

  • state: GovernmentPriceIndex

  • state: RealConsumptionGovernment

  • state: Taxes

  • state: CentralBankProfits

Sets

  • GovernmentBillStock

household_bill_demand(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the household bill demand.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} \frac{B_h(t)}{V^e(t)} = \lambda_0 + \lambda_1 r(t) - \lambda_2 \frac{YD^e(t)}{V^e(t)} \end{align}

Dependency

  • state: ExpectedWealth

  • state: ExpectedDisposableIncome

  • state: InterestRate

  • params: WealthShareBills_Constant

  • params: WealthShareBills_InterestRate

  • params: WealthShareBills_Income

Sets

  • HouseholdBillDemand

household_bill_holdings(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the household bill holdings.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} B_h(t) = B_h(t-1) + (B_h^d(t) - B_h(t-1)) \end{align}

Dependency

  • state: HouseholdBillDemand

Sets

  • HouseholdBillStock

household_money_stock(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the household deposits as a residual.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} H_h(t) = V(t) - B_h(t) \end{align}

Dependency

  • state: Wealth

  • state: HouseholdBillStock

Sets

  • HouseholdMoneyStock

inflation(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Compute the inflation (i.e. term for absence of money illusion)

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} \pi(t) &= \left(\frac{p_c(t) - p_c(t-1)}{p_c(t-1)}\right)\left(\frac{V(t-1)}{p_c(t-1)}\right) \end{align}

Dependency

  • prior: Wealth

  • prior: ConsumerPriceIndex

  • state: ConsumerPriceIndex

Sets

  • ConsumerPriceInflation

initialize()[source]#

Initialize the behavior of Passarella’s 3IO-PC model in the spirit of Godley & Lavoie, by keeping all variables as zero. Accordingly, we can just “pass” the function as by default the state variables are all zero. The only exceptions are the price-indices which we initialize to one

interest_earned_on_bills_household(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the interest earned on bills by the household.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} r(t-1)B_h(t-1) \end{align}

Dependency

  • prior: InterestRate

  • prior: HouseholdBillStock

Sets

  • InterestEarnedOnBillsHousehold

national_income(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

National income is the sum of nominal final demand

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} Y(t) = P^\top(t)d(t) \end{align}

Dependency

  • state: Prices

  • state: RealFinalDemand

Sets

  • NationalIncome

price_indices(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Compute the consumer and government price indices based on their consumption shares

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} p_c(t) &= \beta_{HH}^\top P(t)\\ p_g(t) &= \beta_{G}^\top P(t) \end{align}

Dependency

  • state: Prices

  • params: HouseholdBudgetShare

  • params: GovernmentBudgetShare

Sets

  • ConsumerPriceIndex

  • GovernmentPriceIndex

prices(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Compute the sectoral prices as the sum of unit labour cost and a markup on intermediate prices

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} P_i(t) = \frac{w}{pr_i} + (1 + \mu)\sum_j a_{ij}P_j(t) \end{align}

Dependency

  • scenario: WageRate

  • params: LabourProductivity

  • params: Requirement

  • params: Markup

Sets

  • Prices

propensity_to_consume_income(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Endogenous propensity to consume out of income, dependent on the rate of interest

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} \alpha_1(t) = \alpha_{10} - \alpha_{11} r(t-1) \end{align}

Dependency

  • prior: InterestRate

  • params: PropensityToConsumeIncomeBase

  • params: PropensityToConsumeIncomeInterest

Sets

  • PropensityToConsumeIncome

real_gross_output(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Compute real gross output as the solution to the linear set of equations

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} x(t) = (I - A)^{-1}d(t) \end{align}

Dependency

  • state: RealFinalDemand

  • params: Requirement

Sets

  • RealGrossOutput

set_interest_rate(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Set the interest rate. This is given exogenously by the scenario.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} r(t) = \bar{r} \end{align)

Dependency

  • scenario: InterestRate

Sets

  • InterestRate

step(**kwargs)[source]#

Step function of the Godley-Lavoie 2006 PC model.

taxes(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the taxes.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} T(t) = \theta (Y(t) + r(t-1)B_h(t-1)) \end{align}

Dependency

  • params: TaxRate

  • state: NationalIncome

  • state: InterestEarnedOnBillsHousehold

Sets

  • Taxes

version = 'IOPC'#
wealth(t: int, scenario: dict, params: dict | None = None, **kwargs)[source]#

Calculate the wealth.

Parameters:
  • t (int) – The time step.

  • scenario (dict) – The scenario.

  • params (dict | None) – The parameters.

Equations

\begin{align} V(t) = V(t-1) + YD(t) - C(t) \end{align}

Dependency

  • state: DisposableIncome

  • state: ConsumerPriceIndex

  • state: RealConsumptionHousehold

  • prior: Wealth

Sets

  • Wealth

class macrostat.models.IOPC.IOPC(parameters: ParametersIOPC | None = <macrostat.models.IOPC.parameters.ParametersIOPC object>, variables: VariablesIOPC | None = None, scenarios: ScenariosIOPC | None = None, *args, **kwargs)[source]#

Bases: Model

IOPC model class for Marco Veronese Pasarella’s 3IO-PC model

version = 'IOPC'#
class macrostat.models.IOPC.ParametersIOPC(parameters: dict | None = None, hyperparameters: dict | None = None, bounds: dict | None = None, *args, **kwargs)[source]#

Bases: Parameters

Parameters class for the Godley-Lavoie 2006 PC model.

get_default_hyperparameters()[source]#

Return the default hyperparameter values.

get_default_parameters()[source]#

Return the default parameter values.

version = 'IOPC'#
class macrostat.models.IOPC.ScenariosIOPC(scenario_info: dict | None = None, parameters: ParametersIOPC | None = None, *args, **kwargs)[source]#

Bases: Scenarios

Scenarios class for Marco Veronese Passarella’s 3IO-PC model

get_default_scenario_values()[source]#

Return the default scenario values.

version = 'IOPC'#
class macrostat.models.IOPC.VariablesIOPC(variable_info: dict | None = None, timeseries: dict | None = None, parameters: ParametersIOPC | None = None, *args, **kwargs)[source]#

Bases: Variables

Variables class for Marco Veronese Passarella’s 3IO-PC model

check_health(tolerance: float = 0.0001)[source]#

Check the health of the variables by verifying that the redundant equations hold and that all the assets and liabilities are positive.

Parameters:

tolerance (float (default: 1e-4)) – The tolerance for the checks.

Equations

Redundant equations:
\begin{align} H_h(t) = H_s(t) \end{align}
General checks:
\begin{align} A(t) &> 0 & L(t) &> 0 \end{align}

where \(A(t)\) are all assets and \(L(t)\) are all liabilities.

Returns:

True if the variables are healthy, False otherwise.

Return type:

bool

get_default_variables()[source]#

Return the default variables information dictionary.

version = 'IOPC'#