Deep learning for solving and estimating dynamic macro-finance models

Benjamin Fan, Edward Qiao, Anran Jiao, Zhouzhou Gu, Wenhao Li, Lu Lu

TL;DR

This paper introduces a deep learning framework based on Physics-Informed Neural Networks (PINNs) to simultaneously solve and estimate complex continuous-time macro-finance models. By embedding economic partial differential equations (PDEs) directly into the neural network's loss function, the authors bypass the "curse of dimensionality" and enable efficient parameter estimation without the need for traditional, computationally expensive calibration loops.

What Problem Does This Paper Address?

Modern macro-finance models aim to explain how financial frictions—like borrowing constraints or market illiquidity—impact the broader economy. However, these models are notoriously difficult to work with for three main reasons:

  1. High Non-linearity: Financial constraints and agent preferences create "kinks" and sharp gradients that break standard linearization methods.
  2. The Curse of Dimensionality: Traditional numerical methods (like finite differences) require a grid. As you add more state variables (e.g., wealth, productivity, inflation), the number of grid points grows exponentially, making the problem unsolvable.
  3. Disconnected Estimation: Usually, researchers must solve the model first and then run a separate, intensive "calibration" or "matching moments" process to find the right parameters. This requires solving the model thousands of times.

The authors tackle these challenges by proposing a unified, mesh-free approach that treats model solving and parameter estimation as a single optimization problem.

Methods

The authors leverage Physics-Informed Neural Networks (PINNs). Instead of training a network on a massive dataset of pre-solved examples, a PINN is trained to satisfy the underlying economic logic of the model.

  • Loss Function Integration: The residuals of the model's governing equations—specifically the Hamilton-Jacobi-Bellman (HJB) equation (representing agent optimization) and the Kolmogorov Forward Equation (KFE) (representing the distribution of agents)—are embedded directly into the neural network's loss function.
  • Automatic Differentiation: Rather than using numerical approximations for derivatives (which introduce errors), the framework uses the neural network’s own architecture to calculate exact analytical derivatives.
  • Simultaneous Estimation (Inverse Problems): To estimate unknown parameters (like entry costs or productivity levels), the authors add "moment targets" (e.g., average leverage or productivity observed in real-world data) to the loss function. The network then optimizes its weights and the unknown economic parameters at the same time.
  • Implementation: The models were implemented using the DeepXDE Python library, utilizing the Adam optimizer and learning rate decay. For particularly sensitive parameters, they employed Bayesian Optimization to ensure convergence to the global minimum.

Datasets

As is common in theoretical macroeconomics, the paper does not use traditional "big data" sets. Instead:

  • Collocation Points: The "data" consists of points randomly sampled within the model's state space (e.g., ranges of bank equity and productivity).
  • Moment Targets: For the estimation tasks, the authors use synthetic "ground truth" values derived from the models themselves to demonstrate that the PINN can accurately recover the original parameters.

Key Insights and Ideas

  • Mesh-Free Scalability: Because PINNs sample points randomly rather than relying on a fixed grid, they are theoretically much better suited for high-dimensional models that would otherwise be computationally "impossible."
  • Handling Singularities: The authors demonstrate how to handle boundary singularities (where values go to infinity) by using clever changes of variables (e.g., solving for $1/\theta$ instead of $\theta$).
  • Hard vs. Soft Constraints: The paper shows that while some boundary conditions can be "soft" (added to the loss function), others are better enforced "hard" by baking them into the neural network's architecture to ensure they are satisfied exactly.
  • Unified Framework: The most significant "aha moment" is the demonstration that solving for the value function, the stationary distribution, and the model parameters can happen in one single training run.

Key Results

The authors tested their method on two landmark models:

  1. Industrial Dynamics of Banking: The PINN solved the model with an $L^2$ relative error of only 0.54% for the value function. In the estimation task, it recovered parameters like the "share of labor" ($\alpha$) with an error of just 0.31%.
  2. The Brunnermeier and Sannikov (2014) Macro Model: This model is famous for its complexity and boundary singularities. The PINN successfully captured the sharp non-linearities and predicted the endogenous dividend-paying boundary ($\eta^*$) with an error of approximately 0.1%.
  3. Optimization Robustness: The study found that while random initialization works for simple parameters, Bayesian Optimization provided an order of magnitude improvement in accuracy for sensitive parameters like capital volatility.

Limitations and Future Work

  • Stationarity: The current implementation focuses on models with a stationary population distribution. The authors suggest that future work could extend this to Mean-Field Games, where the distribution itself changes over time.
  • Overidentification: The paper currently solves "exactly identified" problems (where the number of data moments equals the number of parameters). A more generalized version would need to handle overidentified systems and provide statistical error bounds, similar to the Generalized Method of Moments (GMM).
  • Dimensionality Testing: While the method is designed to beat the curse of dimensionality, the examples in this paper are 2D. Testing the framework on 5D or 10D models remains a frontier for future research.

Summary updated

BibTeX
@misc{fan2023deep,
  author = {Benjamin Fan and Edward Qiao and Anran Jiao and Zhouzhou Gu and Wenhao Li and Lu Lu},
  title = {{Deep learning for solving and estimating dynamic macro-finance models}},
  year = {2023},
  eprint = {2305.09783},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.09783},
}
Figure