Skip to content

Commit

Permalink
Add ind-agg PermGroFac constructor function
Browse files Browse the repository at this point in the history
Per meeting on 8/14, CDC wants users to be able to specify idiosyncratic permanent income growth rather than overall permanent income growth. This commit adds a constructor method that combines PermGroFacAgg and PermGroFacInd to make PermGroFac. Someone using it would simply put their idiosyncratic growth information in PermGroFacInd instead of PermGroFac; when they change PermGroFacAgg, just run ThisType.construct('PermGroFac') and it will adjust.
  • Loading branch information
mnwhite committed Aug 17, 2024
1 parent 3e7f4ad commit 7a6baa9
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions HARK/Calibration/Income/IncomeProcesses.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,41 @@ def __call__(self, pLvlNow):
return pLvlNext


def make_PermGroFac_from_ind_and_agg(PermGroFacInd, PermGroFacAgg):
"""
A very simple function that constructs *overall* permanent income growth over
the lifecycle as the sum of idiosyncratic productivity growth PermGroFacInd and
aggregate productivity growth PermGroFacAgg. In most HARK models, PermGroFac
is treated as the overall permanent income growth factor, regardless of source.
In applications in which the user has estimated permanent income growth from
*cross sectional* data, or wants to investigate how a change in aggregate
productivity growth affects behavior or outcomes, this function can be used
as the constructor for PermGroFac.
To use this function, specify idiosyncratic productivity growth in the attribute
PermGroFacInd (or construct it), and put this function as the entry for PermGroFac
in the constructors dictionary of your AgentType subclass instances.
Parameters
----------
PermGroFacInd : [float] or np.array
Lifecycle sequence of idiosyncratic permanent productivity growth factors.
These represent individual-based productivity factors, like experience.
PermGroFacAgg : float
Constant aggregate permanent growth factor, representing (e.g.) TFP.
Returns
-------
PermGroFac : [float] or np.array
Lifecycle sequence of overall permanent productivity growth factors.
Returns same type as PermGroFacInd.
"""
PermGroFac = [PermGroFacAgg * G for G in PermGroFacInd]
if type(PermGroFacInd) is np.array:
PermGroFac = np.array(PermGroFac)
return PermGroFac


###############################################################################

# Define income processes that can be used in the ConsGenIncProcess model
Expand Down

0 comments on commit 7a6baa9

Please sign in to comment.