Mathematical formulations¶
This page states the equations that MeanFlux discretises. It currently covers the general mean field game system in one state dimension and the definitions of the shortage-risk functionals. The supply-chain model and the coupling between tiers will be documented here as the corresponding solvers are released.
Notation¶
| Symbol | Meaning |
|---|---|
| \(x \in \mathbb{R}\) | Inventory level of a firm. A negative value is a backlog. |
| \(m(t, x)\) | Density of the inventory levels in the population at time \(t\). |
| \(u(t, x)\) | Value function of a representative firm. |
| \(\sigma\), \(\nu = \sigma^2 / 2\) | Volatility and the diffusion coefficient it gives. |
| \(H(x, p)\) | Hamiltonian. |
| \(T\) | Time horizon. |
Mean field game system¶
A representative firm controls the drift \(\alpha_t\) of its state,
where \(W\) is a Brownian motion. Given the flow of densities \(m\), the firm minimises
with a running cost \(L\) that is convex in the control, a coupling cost \(f\) and a terminal cost \(g\). The Hamiltonian is the Legendre transform
A mean field game equilibrium is a pair \((u, m)\) that solves the coupled system of Lasry and Lions1, which Huang, Malhamé and Caines derived independently2,
The first equation is a Hamilton-Jacobi-Bellman (HJB) equation that runs backward in time. It gives the optimal drift \(\alpha^*(t, x) = -\partial_p H(x, \partial_x u(t, x))\). The second is a Fokker-Planck (FP) equation that runs forward in time and transports the density under that drift. The two are coupled because the cost \(f\) depends on \(m\) and the drift depends on \(u\).
Stationary system¶
The long-run behaviour is described by the ergodic system1
where the constant \(\lambda\) is the long-run average cost and \(m\) is the stationary density.
Uniqueness¶
Suppose \(H\) is strictly convex in \(p\) and the coupling is monotone, that is
for all densities \(m_1\) and \(m_2\). Then the system has at most one classical solution1.
Discretisation¶
The solvers follow the finite-difference scheme of Achdou and Capuzzo-Dolcetta3. The state is truncated to a bounded interval \([x_{\min}, x_{\max}]\) and both variables are discretised on uniform grids,
with \(h = (x_{\max} - x_{\min}) / (N_x - 1)\) and \(\Delta t = T / N_t\). These
are the classes Grid and TimeGrid.
Time is discretised with implicit Euler steps and the Hamiltonian with a monotone upwind numerical Hamiltonian. The discrete FP operator is the transpose of the linearised discrete HJB operator. This construction conserves the total mass of the density and keeps it non-negative.
Each implicit step of either equation is a tridiagonal linear system per scenario and per node, with row \(i\)
The monotone scheme makes these matrices diagonally dominant by rows, so they can be solved without pivoting5. MeanFlux solves all of them at once with a hybrid of parallel cyclic reduction and the Thomas algorithm6. Reduction levels split every system into independent interleaved subsystems until there are enough of them to occupy the device, and the Thomas algorithm then solves each subsystem in a few sequential steps. The API reference gives the details.
Shortage risk¶
Risk is measured on the equilibrium density. The stockout probability and the expected backlog at time \(t\) are
with \(x^- = \max(-x, 0)\). The conditional value-at-risk of the shortfall at level \(\alpha \in (0, 1)\) uses the formula of Rockafellar and Uryasev4,
-
J.-M. Lasry and P.-L. Lions (2007). Mean field games. Japanese Journal of Mathematics, 2(1), 229-260. ↩↩↩
-
M. Huang, R. P. Malhamé and P. E. Caines (2006). Large population stochastic dynamic games. Communications in Information and Systems, 6(3), 221-252. ↩
-
Y. Achdou and I. Capuzzo-Dolcetta (2010). Mean field games: numerical methods. SIAM Journal on Numerical Analysis, 48(3), 1136-1162. ↩
-
R. T. Rockafellar and S. Uryasev (2000). Optimization of conditional value-at-risk. Journal of Risk, 2(3), 21-41. ↩
-
N. J. Higham (2002). Accuracy and Stability of Numerical Algorithms, 2nd edition, Section 9.5. SIAM. ↩
-
Y. Zhang, J. Cohen and J. D. Owens (2010). Fast tridiagonal solvers on the GPU. Proceedings of the 15th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, 127-136. ↩