The paper we replicated is: Growing Like China
These scripts are used to set up the model parameters, perfrom simulation and visualize the results, which are used to simulate various economic phenomena during China's economic transition as discussed in the paper.
parameter.jl
pre_transition.jl
fun_saving_pre_transition
fun_saving_pre_transition_E
transition.jl
fun_saving_E_existing
fun_saving_E_newly_born
fun_saving_F_existing
fun_saving_F_newly_born
result.jl
pre_transition.jl
and transition.jl
.six_panel.jl
.six_panel.jl
result.jl
aggregated and analyzed data.six_panel.jl
script, combined with aggregated data in result.jl
.fun_saving_F_newly_born
used in transition.jl
. Displaying various economic indicators such as savings rate, investment rate, employment share and TFP growth, these panels rely on data aggregated and analyzed by result.jl
, six_panel.jl
utilizes the output data of result.jl
to display the results computed from pre_transition.jl
and transition.jl
. results from pre_transition.jl
and transition.jl
calculations.1.Run main_parameter.jl
will automatically perform the following steps:
pre_transition.jl
, transition.jl
, result.jl
, and six_panel.jl
in sequence to generate all outputs of the model and visualize the charts.To be more specific,
pre_transition.jl
to model any pre-transition economic conditions and behaviors.transition.jl
to simulate adjustments to the economic transition.result.jl
aggregates data from previous process and conduct a comprehensive economic analysis.six_panel.jl
visualizes the results of the economic model and its predictions.The six-panel figure presents a comparison of various economic indicators between the model's predictions and actual data.
The model effectively captures the trends of key economic variables such as economic growth, employment, wages, capital returns, investment, and saving rates. Despite some discrepancies in certain periods or variables, the model performs well in replicating the major characteristics of economic transformation.
Then, we compare our replication results and the original results. We can see from the two figures that our replication is mostly the same as the paper had. So the result would be similar.
This figure depicts the evolution of key variables during and after the economic transition in a calibrated economic model. The solid and dashed lines in the figure represent the simulation results of the model and the actual data, respectively. The figure illustrates the speed of employment reallocation, the evolution of the savings rate (in a U-shaped dynamic), and the trend in the foreign exchange surplus. The increase in the savings rate is associated with a higher savings rate for E-firm managers, which is the main mechanism driving the increase in savings. At the same time, the model accurately predicts the trend in the foreign exchange surplus, albeit with a slight bias in some years. These demonstrate the degree of agreement and discrepancy between the model and China's actual economic data.
Now we are going to details about the function and the logic.
This repository contains a Julia implementation of a life-cycle savings and consumption model as part of a macroeconomic analysis. The key functions compute the wealth and consumption profiles of newly born workers, existing workers, newly born entrepreneurs, existing entrepreneurs, and individuals in the pre-transition phase over their lifetime.
fun_saving_F_newly_born
The function fun_saving_F_newly_born
simulates the life-cycle savings and consumption behavior of newly born workers based on various economic parameters.
x::Vector
: A vector containing the current time period tt
.dictmain::Dict
: Dictionary containing main parameters:
age_max
: Maximum age of the workers.age_T_w
: Age until which workers earn wages.g_t
: Growth rate of wages.r
: Interest rate.bet
: Discount factor.sig
: Intertemporal elasticity of substitution.dictopt::Dict
: Dictionary containing optional parameters:
w_t
: Time series of wages.result::Dict
: A dictionary containing:
:wealth
: Array of wealth over the worker's lifetime.:consumption
: Array of consumption over the worker's lifetime.Initialization:
wealth
: An array to store the wealth of workers over their lifetime, initialized to zeros.w
: An array to store the life-cycle earnings of workers.Life-Cycle Earnings Computation:
age_T_w
.Lifetime Wealth Calculation:
Optimal Consumption and Savings:
Output:
:wealth
and :consumption
.fun_saving_F_existing
The function fun_saving_F_existing
simulates the life-cycle savings and consumption behavior of existing workers based on their current age and wealth, along with various economic parameters.
x::Vector
: A vector containing:
age
: Current age of the worker.wealth
: Current wealth of the worker.dictmain::Dict
: Dictionary containing main parameters:
age_max
: Maximum age of the workers.age_T_w
: Age until which workers earn wages.g_t
: Growth rate of wages.r
: Interest rate.bet
: Discount factor.sig
: Intertemporal elasticity of substitution.dictopt::Dict
: Dictionary containing optional parameters:
w_t
: Time series of wages.result::Dict
: A dictionary containing:
:wealth
: Array of wealth over the worker's remaining lifetime.:consumption
: Array of consumption over the worker's remaining lifetime.Initialization:
wealth
: An array to store the wealth of workers over their remaining lifetime, initialized to zeros.w
: An array to store the life-cycle earnings of workers.Life-Cycle Earnings Computation:
age_T_w
.Lifetime Wealth Calculation:
Optimal Consumption and Savings:
Output:
:wealth
and :consumption
.fun_saving_E_newly_born
The function fun_saving_E_newly_born
simulates the life-cycle savings and consumption behavior of newly born entrepreneurs based on various economic parameters.
x::Vector
: A vector containing the current time period tt
.dictmain::Dict
: Dictionary containing main parameters:
age_max
: Maximum age of the entrepreneurs.age_T
: Age until which entrepreneurs earn wages.g_t
: Growth rate of wages.r
: Interest rate.bet_E
: Discount factor for entrepreneurs.sig
: Intertemporal elasticity of substitution.ice_t
: Borrowing constraint factor.eta
: Parameter related to the borrowing constraint.dictopt::Dict
: Dictionary containing optional parameters:
m_t
: Time series of entrepreneurial wages.rho_t
: Time series of returns on investments.result::Dict
: A dictionary containing:
:wealth
: Array of wealth over the entrepreneur's lifetime.:consumption
: Array of consumption over the entrepreneur's lifetime.Initialization:
wealth
: An array to store the wealth of entrepreneurs over their lifetime, initialized to zeros.w
: An array to store the life-cycle earnings of entrepreneurs.Life-Cycle Earnings Computation:
age_T
.Adjusting Rate of Return:
rho_t
, r
, ice_t
, and eta
.Lifetime Wealth Calculation:
Optimal Consumption and Savings:
Output:
:wealth
and :consumption
.fun_saving_E_existing
The function fun_saving_E_existing
simulates the life-cycle savings and consumption behavior of existing entrepreneurs based on their current age and wealth, along with various economic parameters.
x::Vector
: A vector containing:
age
: Current age of the entrepreneur.wealth
: Current wealth of the entrepreneur.dictmain::Dict
: Dictionary containing main parameters:
age_max
: Maximum age of the entrepreneurs.age_T
: Age until which entrepreneurs earn wages.g_t
: Growth rate of wages.r
: Interest rate.bet_E
: Discount factor for entrepreneurs.sig
: Intertemporal elasticity of substitution.ice_t
: Borrowing constraint factor.eta
: Parameter related to the borrowing constraint.dictopt::Dict
: Dictionary containing optional parameters:
m_t
: Time series of entrepreneurial wages.rho_t
: Time series of returns on investments.result::Dict
: A dictionary containing:
:wealth
: Array of wealth over the entrepreneur's remaining lifetime.:consumption
: Array of consumption over the entrepreneur's remaining lifetime.Initialization:
wealth
: An array to store the wealth of entrepreneurs over their remaining lifetime, initialized to zeros.w
: An array to store the life-cycle earnings of entrepreneurs.Life-Cycle Earnings Computation:
age_T
.Adjusting Rate of Return:
rho_t
, r
, ice_t
, and eta
.Lifetime Wealth Calculation:
Optimal Consumption and Savings:
Output:
:wealth
and :consumption
.fun_saving_pre_transition
The function fun_saving_pre_transition
simulates the life-cycle savings and consumption behavior of individuals in the pre-transition phase based on their current age, wage, and wealth, along with various economic parameters.
x::Vector
: A vector containing:
age
: Current age of the individual.wage
: Current wage of the individual.wealth
: Current wealth of the individual.dict::Dict
: Dictionary containing parameters:
age_max
: Maximum age of the individual.age_T_w
: Age until which individuals earn wages.g_t
: Growth rate of wages.r
: Interest rate.bet
: Discount factor.sig
: Intertemporal elasticity of substitution.y::Vector
: A vector containing:
savings
: Current savings.wealth_prime
: Wealth in the next period.sr
: Saving rate.consumption
: Current consumption.Initialization:
wealth
: An array to store the wealth of individuals over their lifetime, initialized to zeros.w
: An array to store the life-cycle earnings of individuals.Life-Cycle Earnings Computation:
age_T_w
.Lifetime Wealth Calculation:
Optimal Consumption and Savings:
Output:
savings
, wealth_prime
, sr
, and consumption
.fun_saving_pre_transition_E
The function fun_saving_pre_transition_E
simulates the life-cycle savings and consumption behavior of entrepreneurs in the pre-transition phase based on their current age, wage, and wealth, along with various economic parameters.
x::Vector
: A vector containing:
age
: Current age of the entrepreneur.wage
: Current wage of the entrepreneur.wealth
: Current wealth of the entrepreneur.dict::Dict
: Dictionary containing parameters:
age_max
: Maximum age of the entrepreneur.age_T_w
: Age until which entrepreneurs earn wages.g_t
: Growth rate of wages.r
: Interest rate.bet_E
: Discount factor for entrepreneurs.sig
: Intertemporal elasticity of substitution.y::Vector
: A vector containing:
savings
: Current savings.wealth_prime
: Wealth in the next period.sr
: Saving rate.consumption
: Current consumption.Initialization:
wealth
: An array to store the wealth of entrepreneurs over their lifetime, initialized to zeros.w
: An array to store the life-cycle earnings of entrepreneurs.Life-Cycle Earnings Computation:
age_T_w
.Lifetime Wealth Calculation:
Optimal Consumption and Savings:
Output:
savings
, wealth_prime
, sr
, and consumption
.