A Index and Code Links
A.1 Savings Dynamic Programming links
- Looped Grid Infinite Horizon Dynamic Savings Problem: mlx | m | pdf | html
- Infinite horizon constrained dynamic savings problem with persistent shock.
- The state-space and choice-space share the same asset grid.
- Looped algorithm, slow but easy to modify, useful for developing new models.
- MEconTools: ff_vfi_az_loop()
- Vectorized Grid Infinite Horizon Dynamic Savings Problem: mlx | m | pdf | html
- Vectorized version of ff_vfi_az_loop(), fast and sufficiently approximate value(a,z), but choices not precise.
- Broadcast and vectorized evaluation and maximization.
- Solve u(c) once, and retrieve with cell arrays.
- MEconTools: ff_vfi_az_vec()
- Looped Exact FOC Infinite Horizon Dynamic Savings Problem: mlx | m | pdf | html
- Infinite horizon constrained dynamic savings problem with persistent shock.
- The state-space is on a grid, the choice space are continuous percentages of cash-on-hand.
- Looped exact savings-percentage algorithm, slow but high precision at low grid size.
- Solves for EV(ap,z) given shock state and for a savings choice. Bisection based on FOC with analytical du(c(ap))/dap and spline slopes dEV(ap,z)/dap.
- MEconTools: ff_vfi_az_bisec_loop() + ff_optim_bisec_savezrone()
- Vectorized Exact FOC Infinite Horizon Dynamic Savings Problem: mlx | m | pdf | html
- Vectorized version of ff_vfi_az_bisec_loop() exact savings-percentage algorithm, high precision and high speed.
- MEconTools: ff_vfi_az_bisec_vec() + ff_optim_bisec_savezrone()
- Looped Exact Value Infinite Horizon Dynamic Savings Problem: mlx | m | pdf | html
- Looped infinite horizon constrained dynamic savings problem with persistent shock.
- The state-space is on a grid, the choice space are continuous percentages of cash-on-hand.
- Evaluate value at choice grid iteratively by zooming-in to construct finer savings percentages.
- MEconTools: ff_vfi_az_mzoom_loop() + ff_optim_mzoom_savezrone()
- Vectorized Exact Value Infinite Horizon Dynamic Savings Problem: mlx | m | pdf | html
- Vectorized version of ff_vfi_az_mzoom_loop() exact savings-percentage algorithm.
- MEconTools: ff_vfi_az_mzoom_vec() + ff_optim_mzoom_savezrone()
A.2 Stationary Distribution links
- Looped Grid Stationary Distribution Dynamic Savings Problem: mlx | m | pdf | html
- Stationary distribution for infinite horizon constrained dynamic savings problem with persistent shock.
- The state-space and choice-space share the same asset grid.
- Looped algorithm.
- MEconTools: ff_ds_az_loop()
- Looped Exact Stationary Distribution Dynamic Savings Problem: mlx | m | pdf | html
- Stationary distribution for infinite horizon constrained dynamic savings problem with persistent shock.
- The state-space is on a grid, the choice space are continuous percentages of cash-on-hand.
- Looped algorithm.
- MEconTools: ff_ds_az_cts_loop()
- Vectorized Exact Stationary Distribution Dynamic Savings Problem: mlx | m | pdf | html
- This is the vectorized version of ff_ds_az_cts_loop().
- MEconTools: ff_ds_az_cts_vec(8)
A.3 Summarize Policy and Value links
- Summarize ND Array Policy and Value Functions: mlx | m | pdf | html
- Given an NDarray matrix with N1, N2, …, ND dimensions. Generate average and standard deviation for the 3rd dimension, grouping by the other dimensions.
- For example, show the 5th dimension as the column groups, and the other variables generate combinations shown as rows.
- The resulting summary statistics table contains mean and standard deviation among other statistics over the policy or value contained in the ND array.
- MEconTools: ff_summ_nd_array()
A.4 Distributional Analysis links
- Gateway Joint Probability Mass Statistics: mlx | m | pdf | html
- Given model policy functions and stationary distribution, compute distributional statistics.
- Given discrete probability mass function f(s), and information y(s), x(s), z(s) at each element of the state-space, compute statistics for each variable, y, x, z, which are all discrete random variables.
- Compute correlation and covariance betwen input discrete random variables.
- MEconTools: ff_simu_stats()
- Discrete Random Variable Distributional Statistics: mlx | m | pdf | html
- Model simulation generates discrete random variables, calculate mean, standard deviation, min, max, percentiles, and proportion of outcomes held by x percentiles, etc.
- MEconTools: ff_disc_rand_var_stats()
- Generate Discrete Random Variable: mlx | m | pdf | html
- Given mass at state space points, and y, c, a, z and other outcomes or other information at each corresponding state space points, generate discrete random variable, with unique sorted values, and mass for each unique sorted values.
- Generate additional joint distributions: if initial distribution is over f(a,z), generate joint distribution of f(y,a) or f(y,z).
- MEconTools: ff_disc_rand_var_mass2outcomes()
- Discrete Random Variable Correlation and Covariance: mlx | m | pdf | html
- Given probability mass function f(s), X(s), and Y(s), compute the covariance and correlation betwen X and Y.
- MEconTools: ff_disc_rand_var_mass2covcor()
A.5 Optimizers links
- Bisection Exact Optimal Savings Share Multiple States: mlx | m | pdf | html
- Given a First Order Condition function handle that takes the fraction of resources (cash-on-hand) saved as the input, solve for the optimal savings fraction via bisection. Solve this concurrently for many elements of the state-space. The function handle contains the FOC with parameters and state-space elements embeded.
- MEconTools: ff_optim_bisec_savezrone()
- Multisection Exact Optimal Savings Share Multiple States: mlx | m | pdf | html
- Given a First Order Condition function handle that takes the fraction of resources (cash-on-hand) saved as the input, solve for the optimal savings fraction via multisection where there are multiple evaluations per iteration of the FOC. Solve this concurrently for many elements of the state-space. The function handle contains the FOC with parameters and state-space elements embeded.
- MEconTools: ff_optim_mlsec_savezrone()
- Vectorized Zooming Exact Optimal Savings Share Multiple States: mlx | m | pdf | html
- Given a Utility (not FOC) function handle that takes the fraction of resources (cash-on-hand) saved as the input, solve for the optimal savings fraction via iterative zooming where there are multiple evaluations per iteration of the utility function. Solve this concurrently for many elements of the state-space. The function handle contains the utilty function with parameters and state-space elements embeded.
- MEconTools: ff_optim_mzoom_savezrone()
A.6 Graphs links
- Multiple Line Graph Function: mlx | m | pdf | html
- Policy and Value Function graphs, x-axis one state, color another state, y-axis are value and policies.
- Distributional graphs, x-axis one state, y-axis and color another state, size show distributional mass.
- MEconTools: ff_graph_grid()
A.7 Support Tools links
- Organizes and Prints Container Map Key and Values: mlx | m | pdf | html
- Summarizes the contents of a map container by data types. Includes, scalar, array, matrix, string, functions, tensors (3-tuples), tesseracts (4-tuples).
- MEconTools: ff_container_map_display()
A.8 Data Structures links
- Log and Power Spaced Asset and Choice Grids: mlx | m | pdf | html
- Generate linear, log-space, power-space, or threshold-cut asset or choice grids.
- MEconTools: ff_saveborr_grid()
- Randomly Perturb Some Parameter Value with Varying Magnitudes: mlx | m | pdf | html
- There is a starting estimation parameter value, perturb this initial starting points. Use a scalar so that 0 means almost no change, and 1 means maximum change to control how much to perturb the parameter. This is used for multi-start estimation
- MEconTools: ff_perturb_logn()
- Find Real-valued Domain of a Function: mlx | m | pdf | html
- Checks for valid domain for function that generates real-valued outcomes, and identifies values along the domain that generates positive and negative Values.
- MEconTools: ff_nonimg_posnegbd()
A.9 Common Functions links
- Discretize AR1 Normal Shock Tauchen (1986): mlx | m | pdf | html
- Mean zero AR(1) shock discretize following Tauchen (1986).
- MEconTools: ffy_tauchen()
- Discretize AR1 Normal Shock Rouwenhorst (1995): mlx | m | pdf | html
- Mean zero AR(1) shock discretize following Rouwenhorst (1995).
- MEconTools: ffy_rouwenhorst()
A.10 System links
- Search and Find File Names: mlx | m | pdf | html
- Search and find file names.
- MEconTools: ff_find_files()
- Execute and Export Livescript Files: mlx | m | pdf | html
- Find livescript (mlx) files, execute MLX files, and export MLX files to HTML in a different folder.
- MEconTools: ff_mlx2htmlpdf_runandexport()
The MathWorks Inc. 2019. MATLAB. https://www.mathworks.com/products/matlab.html.
Xie, Yihui. 2020. Bookdown: Authoring Books and Technical Documents with r Markdown. https://CRAN.R-project.org/package=bookdown.