The function sgmodel
computes the solutions to a generic stochastic growth model after discretizing the distribution of the stochastic element.
sgmodel(grid, utiltype, utilparam, A, depre, discount, prod, states, m, rho,
sigma, ...)
The function returns a list containing:
Vector of values for capital.
Vector of size (grid
x States
) indicating which coordinates of the capital grid are the optimal savings decision.
Vector of size (grid
x States
) indicating the optimal consumption decisions using the optimal savings decision, and given the capital level of the corresponding coordinate of Capital grid
.
States of the TFP process.
The probability transition matrix of the process.
The exponent on capital in the Cobb-Douglas production function.
The type of utility function. See the details of "util" for the available types
The discount factor used in the model.
The depreciation rate of capital used in the model.
Autocorrelation of the TFP AR(1) process.
Standard deviation of the white noise in the TFP process.
A numerical value, the number of capital grid points to consider for k (t). Default value set to 1000.
The type of preference for the util
function. Can be "log", "CRRA", "CARA", "Cobb-Douglas", "CES". See description of util
for details. Default type set to "log".
Numerical value, preference parameter for the util
function. See description of util
for details. Default set to 1.
Numerical value, preference parameter for the util
function. See description of util
for details. Default set to 1.
Numerical value for the depreciation parameter. Must be between 0 and 1. Default value set to 1.
Numerical value for the discount factor. Must be (strictly) between 0 and 1. Default value set to 0.95.
Numerical value for the Cobb-Douglas production function. Must be (strictly) between 0 and 1. Default value set to 0.3.
umerical value for the number of states of the Markov process approximating the TFP process. Default value set to 2.
Numerical value for the Rtauchen
function. See description of Rtauchen
for details. Default value set to 3.
Autocorrelation of the TFP AR(1) process, used to approximate the process with a Markov process.
Standard deviation of the white noise in the TFP process, used to approximate the process with a Markov process.
Additional arguments.
Tauchen G (1986), Finite state markov-chain approximations to univariate and vector autoregressions. Economics letters, 20(2), 177--181.
Merton R. C (1971), Optimum consumption and portfolio rules in a continuous-time model. Journal of Economic Theory, 3(4), 373--413. URL https://www.sciencedirect.com/science/article/pii/002205317190038X
model <- sgmodel(grid= 100, rho = 0.2, sigma = 0.02)
grid <- 200
utiltype <- "CRRA"
utilparam <- 4
A <- 1
depre <- 0.03
discount <- 0.95
prod <- 0.3
states <- 5
m <- 10
rho <- 0.2
sigma <- 0.02
model <- sgmodel(grid, utiltype, utilparam, A, depre, discount, prod, states, m, rho, sigma)
Run the code above in your browser using DataLab