Example 5: Model with Heterogeneous Capital
The files described below solve a version of Campbell (1998)'s model of heterogeneous capital.
To use these files, run the Matlab command file 'main.m'.In 'main.m', before specifying the exogenous parameter values, you are asked to specify a number of indicator variables. To have the program solve for the steady state values of the productivity threshold, discretized capital distribution, etc., set findss = 1. To save these steady state and parameter values, set findss = 1 and saveSteady = 1. If findss = 0, you must load a Matlab readable file (*.mat) containing the requisite steady state and parameter values. To have the program linearize the equilibrium conditions, set linearize = 1. To save these linearization coefficients, set linearize = 1 and saveV = 1. If linearize = 0, you must load a Matlab readable file containing the matrix of linearization coefficients.
NOTE: the numerical derivation of these coefficients using the programs contained in the \solve\code\ directory are slow for large values of 'span*sigma' (see the definition of these parameter values in 'main.m'), and the user may wish to find the linearization coefficients through alternative means. To have the program determine the feedback and feedforward matrices, A and B, using the programs contained in the \solve\code\ directory, set solve = 1. To save these matrices and their corresponding linearization parameters, set solve = 1 and saveSoln = 1. If solve = 0, you must load a Matlab readable file containing these values. To have the program derive impulse response functions (IRFs) to a one standard deviation shock to the leading edge technology, set format = 1,2. For IRFs expressed as % deviations from the current, or date t, balanced growth path, set format = 1; for IRFs expressed as % deviations from the unshocked, or date 0, balanced growth path, set format = 2. To have the program generate realizations of unscaled (non-stationary) simulated data, set format = 3. The number of simulations can be specified with the value of nsim. To specify the number of observations in the IRF or simulation run, use nobs.
.m files
| cond1 | Contains the law-of-motion for k(q(l)) for l=1,...,M. The aggregate resource constraint and first order necessary condition (FONC) with respect to N(t) have been substituted in to obtain an expression in k(q), q(q), N, q threshold. |
| cond2 | Contains the FONC with respect to the scaled I(t). |
| cond3 | Contains the FONC with respect to the date t scaled q threshold. |
| cond4 | Contains the FONC with respect to k'(q(l)) for l=1,...,M. |
| main | Computes the steady state, linearizes the FONCs around the steady state, solves the linearized model and simulates it. |
| netonly | Eliminates from the grid points with small capital. |
| quadrad | Computes the intercepts for integration. |
| simulate | Simulates the model giving as output
one of the following:
|
| ssprices | Returns the steady-state values of kbar and q0. This is done by solving the system of linear equations summarized in the FONCs with respect to investment and capital, evaluated at steady-state. |
| ssthresh | Finds the steady state threshold value of q by bisecting the FONC with respect to the cut-off level of q, evaluated at steady-state, within the range [min(q),0]. The FONC itself is contained in 'thcond.m'. |
| steady | Solves for the steady state, given parameters, vector of scaled q values, and the already solved-for scaled q cut-off. |
| thcond | Summarizes the FONC with respect to thetaTh, evaluated at steady state. |
| thetinit | Initial distribution of q. |
.mat files
| SS | Steady state values. |
| V | Coefficients in the log-linearized version of FONC's about the steady state. |
| Soln | Linearization parameters, feedback part of the solution (matrix A) and feedforward part of the solution (matrix B). |
The steady state values, the coefficients of the linearized model, and the solution matrices A and B correspond to the parameters you can find in 'main.m'.
.txt files
| readme | Describes how to use the file 'main.m'. |
Reference
Campbell, Jeffrey R., 1998, Entry, Exit, Embodied Technology, and Business Cycles, Review of Economic Dynamics 1(2), April, pp. 371-408. (IDEAL subscribers can click here to read the abstract and link to a .pdf file.)
Campbell, Jeffrey R., 1998, Computational Appendix to Entry, Exit, Embodied Technology, and Business Cycles, Review of Economic Dynamics 1(2), April, pp. 371-408.