Devlog  /  sim build 0.0.1

The Whipsaw

A stock-flow-consistent economy simulation, written in Rust. This is the build log: what broke, what the numbers actually said, and which of my own instruments turned out to be lying.

Kitchin peak found, 170.7 ticks, 6.02× above background

Decomposing along the “when” axis flipped the diagnosis. Neither hypothesis survived, not mine and not the autonomous demand one, and then the instrument turned up something neither of us thought to ask about.

Napkin: 21%, not half

consumption per tick        151119
of it autonomous (α₂×W)      31725  (21.0%)
household wealth          15856065
household income            131919

Autonomous share holds 20–27% across all 900 ticks, so “the level is anchored by the money stock” is dead. But something else falls out of it: consumption 151k against income 132k. Households are eating through their wealth, and there’s twice as much of it as the stationary target, 120 ticks of income against 60 computed.

Shape in time: it isn’t a slide

tick     GDP   vs prev   unemp        tick     GDP   vs prev
  0   260730     1.000     6.1%        408    94624     0.942
 96   104882     0.755    60.9%        480   106996     1.006
144    71121     0.889    76.6%        528    86318     0.895
168    71278     1.002    74.9%        600   103913     1.119
264   116270     1.030    55.2%        696    82638     0.967
312   113541     1.000    57.2%        768    93625     1.019
360   109780     0.976    58.4%        864    69551     0.958

Peaks 264, ~480, ~624, ~768. Troughs ~168, ~408, ~528, ~696, ~864. Like to like: 216, 144, 144 and 240, 120, 168, 168.

It oscillates around ~90k, period somewhere in 144–216 ticks. The 260k → 71k fall over the first 168 ticks is a birth artefact, the one §4.5 hides with a warm up. My “slide of −55.8%” was measuring the phase of an oscillation over a window shorter than one period of it.

Which means the −51% I’ve been subtracting for three autopsies running isn’t a residual disease at all. It’s the distance between the birth point, 260k, full employment out of the solution, and the system’s own attractor at ~90k. The level question stands, but it’s a question about an attractor now, not about a slide.

And then the main thing

200 year run, series 1, criterion §9.2:

Kitchin  full  170.7 ticks (6.02×), second half  170.7 (5.68×)
Juglar   full  409.6 ticks (0.54×), does not exceed background, as it should not

170.7. Dead centre of 144–192. 6.02× over background where 2× is required, and it survives the check on the second half of the series, so it isn’t a step in the transient.

Stage still isn’t signed off, and there’s one reason: the viability precondition. Over 200 years the level doesn’t hold. GDP sinks to 3287 from a start of 260730, unemployment 93%, three firms out of 141 producing. On a thousand tick horizon there’s a slow fade you can’t see at 900.

Which is exactly the situation that precondition was written for. Without it a 6.02× peak signs the stage off on a dying economy. With it I get an honest answer: the oscillation is real, it’s in the band, and the level doesn’t hold long run.

Side note, my own bug

The long run found one in my flow_gap immediately. Clamp was sitting after Rate::from_ratio, so with a microscopic supply the constructor panicked before the clamp could do anything at all. A clamp after the constructor is a clamp that isn’t there. Fixed by computing in i128 before construction.