Skip to content

pi-kappa-devel/rad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Synopsis

This is the top-level element-documentation of the code that accompanies the numerical section of the article Costly Consideration and Dynamic Choice Set Formation (henceforth the article).

The code implements a simple version of the radial attention model and solves it. For more details on the model's technicalities see the article. The solver is based on a concurrent re-formulation of the value function iteration algorithm. Further, it uses an adaptive search grid implementation to provide more accurate optimal control approximations.

If you use this software, please consider citing it. The permanent link of the software's release version is DOI. Suggested citations can be found at this link.

Installation

The source code of the project can be found at this repository. The easiest way to build the C applications of the project is to use CMAKE. The following macros can be passed to CMAKE :

  • If you want to build with debug symbols and warnings use CMAKE_BUILD_TYPE=Debug.
  • If you want to build fully optimized for execution speed use CMAKE_BUILD_TYPE=Release.
  • If you want to have bound checking for the grids, set GRID_T_SAFE_MODE=1.
  • If you want the parameter maps to check if the passing keys exist, set PMAP_T_SAFE_MODE=1.
  • Lastly, if you want the compilation to include debugging development functionality use RAD_DEBUG=1.

CMAKE produces four targets; three executables and one documentation target. The last one gives this documentation. The executable targets are

  • rad_msol : Solves the radial attention model based on the saved parameterization file.
  • rad_mcont : Resumes the solution of the model that is halted in a previous execution. This is useful when you are using the code in environments with execution-time limits such as in clusters.
  • rad_pardep: Produces the data for the parameter dependence analysis.

The C code was compiled and tested using

  • gcc version 10.2.1 20201125 (Red Hat 10.2.1-9) (GCC)
  • Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27025.1 for x64

The Python code was tested using

  • Python 3.8.6

Functionality

The C code is used to approximate the solutions of the radial attention model. It also stores the solution and parameter analysis' binary data in the file system. The Python code is used to create model logic level objects from the stored binary data. The python code is using the resulting data to produce the tables and the figures of the article. An org document, exported in Html format here, summarizes the main results of the execution.

Concurrency

The concurrency is written on an operating system level using low-level abstractions (i.e. mutexes and locks). In UNIX based systems it is written using the POSIX Threads API pthreads. In windows systems it uses the native windows threading and synchronization APIs.

Documentation

The documentation of the project can be found online here and it is also available for downloading in a PDF format. It is built using DOXYGEN and follows the `repeat your-self documentation approach´.

Only the top-element functionality of the C code is documented. Drilling into lower-level functions requires that you have an understanding of the radial attention model. Knowledge of the standard value function iteration algorithm is another prerequisite. For the parallelization, basic knowledge of system multithreading implementations and the pipeline parallelization pattern is required. There are also some accompanying implementation comments in the source code that is not reported in this documentation.

The Python code is simple and its elements are briefly documented.

Contributors

Pantelis Karapanagiotis

Feel free to join, share, contribute, distribute.

License

The code is distributed under the MIT License. See the LICENSE file.