Solving the HJB Market-Making Model with Matrix Exponentials
Summary
The document explains how to recover the inventory-dependent value function in an exponential-utility market-making model formulated through a Hamilton–Jacobi–Bellman equation. The central step is to set the terminal value for each inventory state, transform it into a vector of exponentials, and propagate that vector backward in time using a matrix exponential.
It describes computing the matrix exponential by diagonalizing the real symmetric matrix, exponentiating its eigenvalues, and transforming back with the eigenvector matrix and its inverse. The resulting vector gives the time-dependent quantities from which the inventory function can be recovered. This is a numerical recipe for evaluating the model and clarifies how the terminal condition enters. The document does not work through a full numerical example or compare the resulting quotes quantitatively with the Avellaneda–Stoikov approximation.
Key ideas
- The terminal inventory penalty determines the terminal vector used in the solution.
- The matrix exponential propagates that vector from the terminal time to an earlier time.
- A real symmetric model matrix can be diagonalized to compute its exponential.
- The resulting state vector is used to recover inventory-dependent market-making values.
Tags
Full text
# Market Making Strategies Found by Hamilton-Jacobi-Bellman Equation
# Market Making Strategies Found by Hamilton-Jacobi-Bellman Equation
Im working my way through the book "Algorithmic and High-Frequency Trading" (AHFT) by Cartea, Jaimungal and Penalva and i'm curious to see how the market making model with an exponential utility function compares to the similar model published by Avelaneda and Stoikov, but im having some problems understanding the result from the book.
In both models the bid and ask prices entered into the order book are calculated from an inventory dependent function, $\theta$ in 2 and $g(t,q)$ or $h(t,q)$ in 1.
To me the main differences seem to be that in in the paper by A&S, this inventory dependent function is expanded in terms of the inventory parameter $q$. And importantly A&S makes a linear approximation of the exponential terms in the exponential part of the HJB equation for $\theta$ (see eq 26 in 2).
In 1 the authors never explicitely calculate the inventory dependent function, $h(t,q)$, but state that one can find it via:
However, I cant figure out how to do the product between $e^\mathbf{A}$ and $\mathbf{z}$ in order to calculate $\omega(t,q)$ and $h(t,q)$ for a given inventory $q$.
Can you help me understand this better?
## Answer by Danny (score 3, accepted)
https://quant.stackexchange.com/a/41087
At the terminal time $T$, the terminal condition is $g(T, q) = -\alpha q^2$, this implies, $$ \begin{aligned} g(T, q) &= \frac{1}{\kappa} \log{\omega(T, q)} = -\alpha q^2\\ \Rightarrow \omega(T,q) &= e^{-\kappa\alpha q^2} \end{aligned} $$ Therefore, $\mathbf{z}$ is given by, $$ \mathbf{z} = \boldsymbol{\omega(T)} = \begin{bmatrix} e^{-\alpha\kappa \bar{q}^2}\\ e^{-\alpha\kappa (\bar{q}-1)^2}\\ \vdots\\ e^{-\alpha\kappa (\underline{q}+1)^2}\\ e^{-\alpha\kappa \underline{q}^2}\\ \end{bmatrix} $$ Next we turn our attention to the term $e^{\mathbf{A}(T-t)}$. The matrix $\mathbf{A}(T-t)$ is a real symmetric matrix, so we know that we can perform eigen-decomposition of $\mathbf{A}(T-t)$ into, $$ \mathbf{A}(T-t) = PDP^{-1} $$ with $D$ the diagonal matrix with elements being the eigenvalues $\lambda_j$, and $P$ is a matrix whose columns are the corresponding eigenvectors $v_j$.
Finally, we use the standard result, $$ \begin{aligned} e^{\mathbf{A}(T-t)} &= Pe^{D}P^{-1}\\ &=P\begin{bmatrix} e^{\lambda_1} & 0 & \ldots & 0\\ 0 & e^{\lambda_2}& \ldots & 0\\ \vdots & \vdots & \ddots & \vdots\\ 0 & 0 &\ldots & e^{\lambda_{(\bar{q} - \underline{q}+1)}} \end{bmatrix}P^{-1} \end{aligned} $$ which would enable us to work out the final expression for $\boldsymbol{\omega(t)}$.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.