format: sfcr-notebook-yaml
formatVersion: 1
id: gl6-dis-rentier-v2-notebook
title: GL6 DIS Rentier Split v2
metadata:
  version: 1
  template: gl6-dis-rentier-v2
cells:
  - markdown:
      id: intro
      title: Overview
      source: This notebook presents a rentier-split extension of the Godley and Lavoie DIS model. It preserves the original inventory, pricing, bank credit, and wealth dynamics, while splitting households into workers and rentiers so that wages, profits, deposit interest, consumption, and wealth accumulation can be tracked separately.
  - matrix:
      id: balance-sheet
      accountingKind: balance-sheet
      title: DIS rentier balance sheet
      description: Balance-sheet matrix for the rentier-split DIS model, separating worker and rentier deposit holdings while keeping firms, inventories, and banks explicit.
      note: "This makes wealth distribution visible: workers and rentiers hold distinct money stocks, while bank liabilities and firm borrowing remain stock-flow consistent."
      sourceRunCellId: baseline-run
      columns: [Workers, Rentiers, Production firms, Banks, Sum]
      sectors: [Workers, Rentiers, Production firms, Banks, ""]
      rows:
        - [Money, Money deposits, +Mhw, +Mhr, "", -Ms, "0"]
        - label: Loans
          values:
            - ""
            - ""
            - -Ld
            - +Ls
            - "0"
        - [Inventories, Inventories, "", "", +INV, "", +INV]
        - [Balance, Balance, -Mhw, -Mhr, "", "", -Mh]
  - matrix:
      id: transaction-flow
      accountingKind: transaction-flow
      title: DIS rentier transactions-flow matrix
      description: Transactions-flow matrix for the rentier-split DIS model, separating wages, profits, deposit interest, consumption, and wealth accumulation between workers and rentiers.
      note: Use this to show that wages primarily fund worker consumption while profits, bank profits, and deposit interest accrue to rentiers, making distributional feedbacks visible in the accounting.
      sourceRunCellId: baseline-run
      columns: [Workers, Rentiers, Firms_current, Firms_capital, Banks_current, Banks_capital, Sum]
      sectors: [Workers, Rentiers, Production firms, Production firms, Banks, Banks, ""]
      rows:
        - [Consumption, Consumption by workers, -Cw, "", +Cw, "", "", "", "0"]
        - [Consumption, Consumption by rentiers, "", -Cr, +Cr, "", "", "", "0"]
        - [Inventories, Ch. Inventories, "", "", +d(INV), -d(INV), "", "", "0"]
        - [Wages, Wages, +WB, "", -WB, "", "", "", "0"]
        - [Interest, Interest on loans, "", "", "-rl[-1] * Ld[-1]", "", "+rl[-1] * Ls[-1]", "", "0"]
        - [Profits, Entrepreneurial profits, "", +EF, -EF, "", "", "", "0"]
        - [Profits, Bank profits, "", +EFb, "", "", -EFb, "", "0"]
        - [Interest, Interest on worker deposits, "+rm[-1] * Mhw[-1]", "", "", "", "-rm[-1] * Mhw[-1]", "", "0"]
        - [Interest, Interest on rentier deposits, "", "+rm[-1] * Mhr[-1]", "", "", "-rm[-1] * Mhr[-1]", "", "0"]
        - [Loans, Change loans, "", "", "", +d(Ld), "", -d(Ls), "0"]
        - [Deposits, Change deposits, -d(Mhw), -d(Mhr), "", "", "", +d(Ms), "0"]
        - [Sum, Sum, "0", "0", "0", "0", "0", "0", "0"]
  - sequence:
      id: transaction-flow-sequence
      title: DIS rentier transaction flow sequence
      source:
        kind: matrix
        matrixCellId: transaction-flow
      description: Sequence view of the rentier-split DIS transactions-flow matrix, showing how spending, income, and financial positions propagate through the selected period.
  - equations:
      id: equations
      title: DIS rentier model
      modelId: equations
      collapsed: true
      rows:
        - [y, s_E + inv_E - lag(inv), "Output determined by expected sales and inventory adjustment."]
        - [inv_T, sigma_T * s_E, "Target inventory stock as a ratio of expected sales."]
        - [inv_E, lag(inv) + gamma * (inv_T - lag(inv)), "Expected inventory stock adjusts toward the target."]
        - [inv, lag(inv) + (y - s), "Realized inventories evolve with production minus sales."]
        - [s_E, beta * lag(s) + (1 - beta) * lag(s_E), "Expected sales formed adaptively."]
        - [s, c, "Real sales equal real consumption demand."]
        - [N, y / pr, "Employment from output and productivity."]
        - [WB, N * W, "Wage bill."]
        - [UC, WB / y, "Unit cost."]
        - [INV, inv * UC, "Nominal inventories."]
        - [S, p * s, "Nominal sales."]
        - [p, (1 + phi) * NHUC, "Price level."]
        - [NHUC, (1 - sigma_T) * UC + sigma_T * (1 + lag(rl)) * lag(UC), "Normalized historic unit cost."]
        - [EF, S - WB + (INV - lag(INV)) - lag(rl) * lag(INV), "Entrepreneurial profits."]
        - [Ld, INV, "Demand for loans."]
        - [Ls, Ld, "Supply of loans."]
        - [Ms, Ls, "Supply of deposits."]
        - [rm, rl - add, "Deposit rate."]
        - [EFb, lag(rl) * lag(Ls) - lag(rm) * lag(Mh), "Bank profits."]
        - [YDw, WB + lag(rm) * lag(Mhw), "Worker disposable income."]
        - [YDr, EF + EFb + lag(rm) * lag(Mhr), "Rentier disposable income."]
        - [Mhw, lag(Mhw) + YDw - Cw, "Worker deposits."]
        - [Mhr, lag(Mhr) + YDr - Cr, "Rentier deposits."]
        - [Mh, Mhw + Mhr, "Aggregate household deposits."]
        - [mhw, Mhw / p, "Real worker wealth."]
        - [mhr, Mhr / p, "Real rentier wealth."]
        - [ydhsw, c_w + (mhw - lag(mhw)), "Worker Haig-Simons real disposable income."]
        - [ydhsr, c_r + (mhr - lag(mhr)), "Rentier Haig-Simons real disposable income."]
        - [ydhsw_E, epsilon * lag(ydhsw) + (1 - epsilon) * lag(ydhsw_E), "Expected worker Haig-Simons income."]
        - [ydhsr_E, epsilon * lag(ydhsr) + (1 - epsilon) * lag(ydhsr_E), "Expected rentier Haig-Simons income."]
        - [c_w, alpha0w + alpha1w * ydhsw_E + alpha2w * lag(mhw), "Real worker consumption demand."]
        - [c_r, alpha0r + alpha1r * ydhsr_E + alpha2r * lag(mhr), "Real rentier consumption demand."]
        - [c, c_w + c_r, "Real aggregate consumption demand."]
        - [Cw, c_w * p, "Nominal worker consumption."]
        - [Cr, c_r * p, "Nominal rentier consumption."]
        - [ydhs, ydhsw + ydhsr, "Aggregate Haig-Simons real disposable income."]
  - solver:
      id: solver
      title: Solver
      modelId: equations
      collapsed: true
      method: newton
      tolerance: "1e-10"
      maxIterations: 200
      defaultInitialValue: "1e-15"
      hiddenLeftVariable: ""
      hiddenRightVariable: ""
      hiddenTolerance: "0.00001"
      relativeHiddenTolerance: false
  - externals:
      id: externals-equations
      title: Externals
      modelId: equations
      collapsed: true
      rows:
        - [rl, 0.025, "Interest rate on loans."]
        - [pr, 1, "Labor productivity."]
        - [W, 0.75, "Money wage."]
        - [add, 0.02, "Spread between loan and deposit rates."]
        - [alpha0w, 10, "Autonomous worker consumption."]
        - [alpha1w, 0.85, "Worker propensity to consume out of expected disposable income."]
        - [alpha2w, 0.05, "Worker propensity to consume out of wealth."]
        - [alpha0r, 5, "Autonomous rentier consumption."]
        - [alpha1r, 0.7, "Rentier propensity to consume out of expected disposable income."]
        - [alpha2r, 0.2, "Rentier propensity to consume out of wealth."]
        - [beta, 0.75, "Speed of sales expectations adjustment."]
        - [epsilon, 0.75, "Speed of income expectations adjustment."]
        - [gamma, 0.25, "Speed of inventory adjustment."]
        - [phi, 0.25, "Costing margin."]
        - [sigma_T, 0.15, "Target inventory-to-sales ratio."]
  - initial-values:
      id: initial-values-equations
      title: Initial values
      modelId: equations
      collapsed: true
      rows:
        - [Mhw, 40]
        - [Mhr, 60]
        - [Mh, 100]
        - [inv, 15]
        - [s_E, 100]
        - [ydhsw_E, 40]
        - [ydhsr_E, 35]
  - run:
      id: baseline-run
      title: Baseline run
      description: Baseline rentier-split DIS simulation showing how inventory adjustment, bank credit, and worker/rentier wealth co-evolve under the Mh = Ms closure condition.
      mode: baseline
      periods: 100
      resultKey: gl6_dis_rentier_baseline
      sourceModelId: equations
  - chart:
      id: baseline-chart
      title: Baseline distribution variables
      variables:
        - ydhsw
        - ydhsr
        - c_w
        - c_r
        - Mhw
        - Mhr
      axisMode: separate
      axisSnapTolarance: 0.5
      seriesRanges:
        Mhw:
          includeZero: true
        Mhr:
          includeZero: true
      sourceRunCellId: baseline-run
  - table:
      id: baseline-table
      title: Baseline variable summary
      variables:
        - y
        - ydhs
        - ydhsw
        - ydhsr
        - c
        - c_w
        - c_r
        - p
        - Mh
        - Mhw
        - Mhr
        - INV
      sourceRunCellId: baseline-run
  - markdown:
      id: scenario-1-note
      title: Scenario 1
      source: Scenario 1 raises the costing margin `phi` from 0.25 to 0.35 between periods 5 and 40.
  - run:
      id: scenario-1-run
      title: "Scenario 1: costing margin shock"
      mode: scenario
      scenario:
        shocks:
          - rangeInclusive:
              - 5
              - 40
            variables:
              phi:
                kind: constant
                value: 0.35
      baselineRunCellId: baseline-run
      periods: 40
      resultKey: gl6_dis_rentier_s1
      sourceModelId: equations
  - chart:
      id: scenario-1-chart
      title: Scenario 1 distribution and prices
      variables:
        - c_w
        - c_r
        - ydhsw
        - ydhsr
        - p
      axisMode: separate
      axisSnapTolarance: 0.5
      seriesRanges:
        p:
          includeZero: true
      sourceRunCellId: scenario-1-run
  - markdown:
      id: scenario-2-note
      title: Scenario 2
      source: Scenario 2 raises the target inventories-to-sales ratio `sigma_T` from 0.15 to 0.25 between periods 5 and 50.
  - run:
      id: scenario-2-run
      title: "Scenario 2: inventory target shock"
      mode: scenario
      scenario:
        shocks:
          - rangeInclusive:
              - 5
              - 50
            variables:
              sigma_T:
                kind: constant
                value: 0.25
      baselineRunCellId: baseline-run
      periods: 50
      resultKey: gl6_dis_rentier_s2
      sourceModelId: equations
  - chart:
      id: scenario-2-chart
      title: Scenario 2 inventories and distribution
      variables:
        - ydhsw
        - ydhsr
        - inv
        - inv_E
        - Mhw
        - Mhr
      axisMode: separate
      axisSnapTolarance: 0.5
      seriesRanges:
        inv:
          includeZero: true
        inv_E:
          includeZero: true
      sourceRunCellId: scenario-2-run
  - sequence:
      id: equation-dependency-graph
      title: DIS rentier equation dependency graph
      source:
        kind: dependency
        modelId: equations
        stripSectorSource: columns
        showAccountingStrips: true
        showExogenous: false
      description: Dependency view of the rentier-split DIS equations, highlighting how expected sales, inventories, pricing, bank credit, wage income, profits, deposit interest, and wealth feed back through the model over time.
      note: Use this alongside the transactions-flow matrix to connect the accounting structure with the model's dynamic distributional adjustment mechanisms.
      collapsed: true
