Agent-Based Models (Part 8)
Azimuth 2024-04-16
Last time I presented a class of agent-based models where agents hop around a graph in a stochastic way. Each vertex of the graph is some ‘state’ agents can be in, and each edge is called a ‘transition’. In these models, the probability per time of an agent making a transition and leaving some state can depend on when it arrived at that state. It can also depend on which agents are in other states that are ‘linked’ to that edge—and when those agents arrived.
I’ve been trying to generalize this framework to handle processes where agents are born or die—or perhaps more generally, processes where some number of agents turn into some other number of agents. There’s already a framework that does something sort of like this. It’s called ‘stochastic Petri nets’, and we explained this framework here:
• John Baez and Jacob Biamonte, Quantum Techniques for Stochastic Mechanics, World Scientific Press, Singapore, 2018. (See also blog articles here.)
However, in their simplest form, stochastic Petri nets are designed for agents whose only distinguishing information is which state they’re in. They don’t have ‘names’—that is, individual identities. Thus, even calling them ‘agents’ is a bit of a stretch: usually they’re called ‘tokens’, since they’re drawn as black dots.
We could try to enhance the Petri net framework to give tokens names and other identifying features. There are various imaginable ways to do this, such as ‘colored Petri nets’. But so far this approach seems rather ill-adapted for processes where agents have identities—perhaps because I’m not thinking about the problem the right way.
So, at some point I decided to try something less ambitious. It turns out that in applications to epidemiology, general processes where n agents come in and m go out are not often required. So I’ve been trying to minimally enhance the framework from last time to include processes ‘birth’ and ‘death’ processes as well as transitions from state to state.
As I thought about this, some questions kept plaguing me:
When an agent gets created, or ‘born’, which one actually gets born? In other words, what is its name? Its precise name may not matter, but if we want to keep track of it after it’s born, we need to give it a name. And this name had better be ‘fresh’: not already the name of some other agent.
There’s also the question of what happens when an agent gets destroyed, or ‘dies’. This feels less difficult: there just stops being an agent with the given name. But probably we want to prevent a new agent from having the same name as that dead agent.
Both these questions seem fairly simple, but so far they’re making it hard for me to invent a truly elegant framework. At first I tried to separately describe transitions between states, births, and deaths. But this seemed to triplicate the amount of work I needed to do.
Then I tried models that have
• a finite set of states,
• a finite set of transitions,
• maps mapping each transition to its upstream and downstream states.
Here is the disjoint union of and a singleton whose one element is called undefined. Maps from to are a standard way to talk about partially defined maps from to We get four cases:
1) If the downstream of a transition is defined (i.e. in ) but its upstream is undefined we call this transition a birth transition.
2) If the upstream of a transition is defined but its downstream is undefined we call this transition a death transition.
3) If the upstream and downstream of a transition are both defined we call this transition a transformation. In practice most of transitions will be of this sort.
4) We never need transitions whose upstream and downstream are undefined: these would describe agents that pop into existence and instantly disappear.
This is sort of nice, except for the fourth case. Unfortunately when I go ahead and try to actually describe a model based on this paradigm, I seem still to wind up needing to handle births, deaths and transformations quite differently.
For example, last time my models had a fixed set of agents. To handle births and deaths, I wanted to make this set time-dependent. But I need to separately say how this works for transformations, birth transitions and death transitions. For transformations we don’t change For birth transitions we add a new element to And for death transitions we remove an element from and maybe record its name on a ledger or drive a stake through its heart to make sure it can never be born again!
So far this is tolerable, but things get worse. Our model also needs ‘links’ from states to transitions, to say how agents present in those states affect the timing of those transition. These are used in the ‘jump function’, a stochastic function that answers this question:
If at time agent arrives at the state upstream to some transition and the agents at states linked to the transition form some set when will agent make the transition given that it doesn’t do anything else first?
This works fine for transformations, meaning transitions that have both an upstream and downstream state. It works just a tiny bit differently for death transitions. But birth transitions are quite different: since newly born agents don’t have a previous upstream state , they don’t have a time at which they arrived at that state.
Perhaps this is just how modeling works: perhaps the search for a staggeringly beautiful framework is a distraction. But another approach just occurred to me. Today I just want to briefly state it. I don’t want to write a full blog article on it yet, since I’ve already spent a lot of time writing two articles that I deleted when I became disgusted with them—and I might become disgusted with this approach too!
Briefly, this approach is exactly the approach I described last time. There are fundamentally no births and no deaths: all transitions have an upstream and a downstream state. There is a fixed set of agents that does not change with time. We handle births and deaths using a dirty trick.
Namely, births are transitions out of a ‘preborn’ state. Agents hang around in these states until they are born.
Similarly, deaths are transitions to a ‘dead’ state.
There can be multiple ‘preborn’ states and ‘dead’ states, if that turns out to be useful. But simply by making the preborn states distinct from the dead states, we can prevent ‘reincarnation’—that is, the birth of a new agent that happens to equal an agent that previously died.
I’m hoping that when we proceed this way, we can shoehorn birth and death processes into the framework described last time, without really needing to modify it at all! All we’re doing is exploiting it in a new way.
Here’s one possible problem: if we start with a finite number of agents in the ‘preborn’ states, the population of agents can’t grow indefinitely! But this doesn’t seem very dire. For most agent-based models we don’t feel a need to let the number of agents grow arbitrarily large.
There could be other problems. So I’ll post this now before I think of them.