The algorithm receives parameters from the outside world, solves the model, and returns moments of the simulated data as output.
There are three types of parameters (mutually exclusive categories):
- Numerical: Are not part of the mathematical representation of the model. Should not play any role in the economic implications of the solution of the model. Should only be relevant for speed and precision. Examples include: grid sizes, tolerance values, etc.
- Assigned: Are part of the mathematical representation of the model. Are chosen outside of the calibration exercise.
- Calibrated: Are determined by the calibration exercise in which the distance between the moments generated by the model and the moments observed in the data is minimized.
Mains steps to solve the model
- Compute decision rules using value function iteration.
- Use Golden search method to find value of assets that solves the Bellman equations.
- Use decision rules to simulate life of a large number of agents and compute targeted moments.
These instructions consider
GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0 on a double core machine with 15 GB of RAM memory. Execution time for the above is around 45 minutes to find equilibrium prices. The output of the code is stored in the folder where the executable is saved.
- Navigate to the folder where the
.f90files are located.
- Create an executable file with gfortran:
gfortran -g -fcheck=all -fbacktrace -Wall -mcmodel=large Globals.f90 Utils.f90 Initialisation.f90 VFiteration.f90 Households.f90 Simulation.f90 Main.f90 -o main.out.
gfortran -mcmodel=large Globals.f90 Utils.f90 Initialisation.f90 VFiteration.f90 Households.f90 Simulation.f90 Main.f90 -O3 -o main.out