Complete DGP

The full causal graph behind every generated run, from the scripted macro layer to the paperwork an analyst receives

Every mechanism on the Theory page and every hidden table on Checking ground truth fits into one causal graph. This page draws it whole: the macro layer that never listens to anything (top), the micro decisions recomputed every period (middle), the always-conserved true state those decisions produce, and the recording layer’s one-way tap that turns true state into the paperwork an analyst actually receives (bottom).

graph TD
    subgraph MACRO[Macro layer: scripted, exogenous]
        CAL[Calendar: day-of-week, holidays]
        WX[Weather: temperature, rain]
        SHOCK[Macro cost shocks: Poisson events]
        TAX[Tax schedule: VAT, profit tax]
        POP[Household population: arrivals and departures]
    end

    subgraph DERIVED[Derived macro processes]
        DEMMOD[Demand modifier M_ct]
        TRAFFIC[Traffic modifier Lambda_t]
        COSTMULT[Wholesale CostMult_ct]
        BUDGET[Household budget B_iw]
    end

    CAL --> DEMMOD
    WX --> DEMMOD
    CAL --> TRAFFIC
    WX --> TRAFFIC
    SHOCK --> COSTMULT
    SHOCK --> BUDGET

    subgraph OPENING[Owner opening decision, one-shot]
        TRUEDEM[True demand D_cl]
        BELIEF["Owner belief D_hat_cl = D_cl times e to the delta_c"]
        MILP[Opening MILP: location, assortment, quantities, staffing]
    end

    POP --> TRUEDEM
    TRUEDEM --> BELIEF
    BELIEF --> MILP

    subgraph MICRO[Micro layer: recomputed every period]
        PANTRY[Customer pantry P_ict]
        NEED[Category need theta_ict]
        UTIL[Purchase utility U_is]
        CHOICE[Purchase choice: softmax]
        PRICE[Shelf price: menu-cost smoothing]
        RESTOCK[Adaptive restocking: trailing 4-week average]
        SPOIL[Spoilage: Binomial]
        EXPAND[Expansion decision: retained-earnings threshold]
    end

    DEMMOD --> NEED
    PANTRY --> NEED
    NEED --> UTIL
    UTIL --> CHOICE
    PRICE --> UTIL
    BUDGET --> CHOICE
    TRAFFIC --> CHOICE
    CHOICE --> PANTRY

    COSTMULT --> PRICE
    TAX --> PRICE

    CHOICE --> RESTOCK
    MILP --> RESTOCK
    RESTOCK --> SPOIL
    WX --> SPOIL
    SHOCK --> SPOIL

    RESTOCK --> EXPAND
    CHOICE --> EXPAND

    subgraph TRUTH[True simulated state, always exactly conserved]
        TRUESTOCK[True stock S_st]
        TRUELEDGER[True ledger pi_realized]
    end

    CHOICE --> TRUESTOCK
    RESTOCK --> TRUESTOCK
    SPOIL --> TRUESTOCK
    CHOICE --> TRUELEDGER
    RESTOCK --> TRUELEDGER
    TAX --> TRUELEDGER
    EXPAND --> TRUELEDGER

    subgraph RECORDING[Recording layer, applied only at export]
        DEFECTS[Paperwork defects D_st]
    end

    subgraph VISIBLE[visible folder: what an analyst receives]
        RECEIPTS[receipts.csv]
        PROCURE[procurement.csv]
        INVEOD[inventory_eod.csv]
        WRITEOFFS[write_offs.csv]
        LEDGER[cost_sheet.csv]
    end

    TRUESTOCK --> DEFECTS
    TRUELEDGER --> DEFECTS
    DEFECTS --> RECEIPTS
    DEFECTS --> PROCURE
    DEFECTS --> INVEOD
    SPOIL --> WRITEOFFS
    TRUELEDGER --> LEDGER

    subgraph HIDDEN[hidden folder: the answer key]
        IMPERF[hidden_imperfections]
        HIDDEMAND[hidden_hidden_demand]
    end

    DEFECTS --> IMPERF
    CHOICE --> HIDDEMAND

Reading the graph

  • Macro (top): written down in advance, on a fixed calendar, and never a function of anything the simulated people do. This is Theory’s Definition 1, and it is what licenses the counterfactual-replay result in Section 8: editing only this layer and replaying the rest with random draws held fixed gives an exact causal effect, not an estimate.
  • The opening decision: a one-shot mixed integer program, solved once against a noisy belief about true demand the owner never observes directly (Section 3).
  • Micro (middle): recomputed fresh every period from the current state, never scripted. The purchase choice feeds the customer’s own pantry state one period later, the one real feedback loop inside the micro layer.
  • True state: always exactly conserved. Every unit bought, sold, or spoiled is accounted for, and every euro that moves is tracked, before any paperwork noise is applied.
  • Recording (bottom): a one-way tap. Defects are drawn from the true state and written into visible/, but never fed back into the simulation. This is why hidden/ can grade visible/ (see Checking ground truth) without the grading process itself disturbing the thing being graded.

Read more

  • Theory: the full model specification each node in this graph implements.
  • Checking ground truth: every hidden_* table this graph’s recording layer feeds, and a worked example of grading against one.
  • Analysis catalog: the 62 questions that walk this graph in the other direction, from visible/ data back toward a cause.