Example #1
0
# survival probability, and income distribution.  Each of these needs to be specifically set.
# Do that here, except income distribution.  That will be done later, because we want to examine
# the effects of different income distributions.

ChinaExample.assignParameters(
    PermGroFac=[
        np.array([1., 1.06**(.25)])
    ],  #needs to be a list, with 0th element of shape of shape (StateCount,)
    Rfree=np.array(StateCount *
                   [init_China_parameters['Rfree']
                    ]),  #need to be an array, of shape (StateCount,)
    LivPrb=[
        np.array(StateCount * [init_China_parameters['LivPrb']][0])
    ],  #needs to be a list, with 0th element of shape of shape (StateCount,)
    cycles=0)
ChinaExample.track_vars = ['aNrmNow', 'cNrmNow',
                           'pLvlNow']  # Names of variables to be tracked

####################################################################################################
####################################################################################################
"""
Now, add in ex-ante heterogeneity in consumers' discount factors
"""

# The cstwMPC parameters do not define a discount factor, since there is ex-ante heterogeneity
# in the discount factor.  To prepare to create this ex-ante heterogeneity, first create
# the desired number of consumer types

num_consumer_types = 7  # declare the number of types we want
ChineseConsumerTypes = []  # initialize an empty list

for nn in range(num_consumer_types):
Example #2
0
### Import and initialize the HARK ConsumerType we want 
### Here, we bring in an agent making a consumption/savings decision every period, subject
### to transitory and permanent income shocks, AND a Markov shock
from ConsMarkovModel import MarkovConsumerType
ChinaExample = MarkovConsumerType(**init_China_parameters)

# Currently, Markov states can differ in their interest factor, permanent growth factor, 
# survival probability, and income distribution.  Each of these needs to be specifically set.  
# Do that here, except income distribution.  That will be done later, because we want to examine
# the effects of different income distributions.

ChinaExample.assignParameters(PermGroFac = [np.array([1.,1.06 ** (.25)])], #needs to be a list, with 0th element of shape of shape (StateCount,)
                              Rfree      = np.array(StateCount*[init_China_parameters['Rfree']]), #need to be an array, of shape (StateCount,)
                              LivPrb     = [np.array(StateCount*[init_China_parameters['LivPrb']][0])], #needs to be a list, with 0th element of shape of shape (StateCount,)
                              cycles     = 0)
ChinaExample.track_vars = ['aNrmNow','cNrmNow','pLvlNow'] # Names of variables to be tracked

####################################################################################################
####################################################################################################
"""
Now, add in ex-ante heterogeneity in consumers' discount factors
"""

# The cstwMPC parameters do not define a discount factor, since there is ex-ante heterogeneity
# in the discount factor.  To prepare to create this ex-ante heterogeneity, first create
# the desired number of consumer types

num_consumer_types   = 7 # declare the number of types we want
ChineseConsumerTypes = [] # initialize an empty list

for nn in range(num_consumer_types):