Codes
- Heterogeneous Agent Models in Asset Pricing: The Dynamic Programming Approach and the Finite Difference Method (2024), (SSRN)
- MainCode: It is a function that solves the PDE of Ak (the equilibrium HJB equation for agent k) in an economy with two agents differing in their RRA. This function implements the Finite Difference method with implicit and upwind schemes.
-
- Risk-Sharing-Rule: This function solves the risk-sharing rule and obtains the optimal consumption for the more risk-averse agent. The MainCode calls this function.
-
- PolicyFunctions: It uses the function MainCode to obtain Ak, optimal consumption, portfolio, wealth, and equilibrium asset prices.
-
- InspectingRRA-Heterogeneity: It solves a two-agent model with two calibrations: the baseline calibration and an economy with a higher RRA for the more risk-averse agent. This m-file plots the optimal quantities and asset prices for both economies.
-
How to Build and Solve Continuous-time Heterogeneous Agents Models in Asset Pricing? The Martingale Approach and the Finite Difference Method (2024)
-
MainCode: It solves the PDE of stock price for a two-agent model with risk-aversion heterogeneity for RRA_agent1 = 2*RRA_agent2. It implements the Finite Difference method with implicit and upwind schemes.
-
PolicyFunctions: It uses the output of Maincode to calculate policy functions.
-
SensitivityFunction: A function that solves the PDE of stock price and obtains policy functions. This function depends on model parameters.
-
SensitivityAnalysis: It uses SensitivityFunction to obtain policy functions when parameters of the endowment process and the relative risk aversion of agents change.
- AlternativeCalibration: It uses SensitivityFunction to solve the PDE of stock price and obtain policy functions for three different parameter calibrations.
-
RRArange: A function that calculates the range of the RRA of each agent and the maximum value of the RRA of the more risk-averse agent when RRA_agent1 = 2*RRA_agent2.
-
NumericalExpectation: A function that approximates the expectation presented in the wealth of the more risk-averse agent using Gaussian quadrature.
-
PDEwithoutBoundaries: It solves the PDE of stock price without considering boundary conditions.
-
- A DSGE Model with Government-owned Banks (2024)
-
Matlab code to simulate a DSGE model with government banks. Parameter sensitivity is analyzed:Code
-