This is a moderately sized release with several exciting new features, as well as many small improvements and fixes. Most of the breaking changes (see below) are very small adjustments to parameter names or formats; two functions also had their name change. The only significant breaking change is a reworking of the interaction between AgentType instances and their associated Market with respect to aggregate-level parameters.
The new features are headlined by the addition of two models with consumption habits in the new ConsHabitModel module. Additionally, HARK's automatic HA-SSJ construction method has been extended to life-cycle models, rather than only infinite horizon models.
There are some breaking changes:
AgentTypesubclasses that had aget_economy_datamethod now use the generalAgentType.get_market_paramsmethod, which exactly replicates their prior operation. See #1719- As a consequence of the above, random seeds on the distributions of some
AgentTypesubclasses will change because the order in which they are created during instantiation has changed. - Parameter
PortfolioBoolhas been deprecated. To allow portfolio choice forRiskyAssetConsumerType, just setRiskyShareFixed=None. #1740 - The parameter
BeqCRRAhas been deprecated; agents with a warm glow bequest motive must use the same CRRA as their ordinary utility function. #1758 - "Terminal bequest parameters" have been deprecated; agents have the same bequest motive in period T as they do in all other periods. #1758
calc_expectationhas been renamed toexpected_with_loop; useexpectedand passvectorized=Falsefor this functionality. #1763- The argument
distinexpectedhas been renamed todstn. #1763 - The function
make_exponential_gridhas been renamed tomake_polynomial_gridto reduce confusion withmake_grid_exp_mult. #1762
Major Changes
- The new way to set up
AgentTypeinstances with an associatedMarketis to create them (with the agents in theMarket'sagentsattribute), then invoke theMarket's newgive_agent_params()method. #1719 - The above method calls each
agent'sget_market_params()method, which references themarket_varsclass attribute for the names of objects to take from the associatedMarket. - All interpolator classes now have default derivative methods using finite differences. These are fallback methods, and are already overridden by most subclasses. #1723
- New consumption-saving model with habit formation has been added; extends IndShockConsumerType model. #1739
- Added habit-formation model with portfolio allocation, along with example notebooks. #1748
- Simulator class has new method
simulate_shock_by_gridsto perturb the steady state distribution and then simulate by matrix transition methods. #1754 - Simplify parameters in
ConsBequestModel.pyto eliminate "terminal" bequest parameters and different CRRA for bequests than consumption. #1758 - The
make_basic_SSJmethod can now handle life-cycle models (cycles=1) as well as standard infinite horizon models. #1718
Minor Changes
- The special constructor
get_it_fromcan now interpret the referenced attribute being a single value (any numeric or string) and will simply copy it to the new name. #1719 - A
Market'scalc_dynamicsfunction/method can now use arguments other than those named intrack_vars; HARK will look for those names as attributes of theMarket. #1719 - The _derY method for
LowerEnvelope2DandLowerEnvelope3Dwere previously bugged and returned nonsense, now fixed. #1723 - Updated syntax in a few places that tried to convert singleton array to a float, to ensure compatibility with NumPy 2.4+ #1725
- Add new income shock constructor that incorporates Velasquez-Giraldo's representation of medical expenses as negative transitory income shocks. #1724
- Add parameter dictionary with Fulford and Low's estimates for all expenses (not just medical) for use by MedShockConsumerType. #1724
- Refactoring of representative agent model solver and the "labeled" submodule. #1727
- Example notebooks for all models with portfolio choice have been significantly expanded and improved. #1740
- Example notebooks for models in
ConsAggShockModel.pyhave been improved and expanded from their prior form. #1738 - The
labelsargument now works as intended withdistribution.expected. #1742 - Example notebook
Transition_Matrix_Example.ipynbhas been cleaned up and expanded. #1744 AggIndMarkovConsumerTypeadded for models with both aggregate (shared) and idiosyncratic discrete states;KrusellSmithTyperefactored to extend it. #1747- Light safety fixes to the new
HabitConsumerType. #1753 - Example notebooks for models in
ConsBequestModel.pyhave been improved and expanded from their prior form. #1754 - Example notebooks for KinkedRconsumerType, MarkovConsumerType, LaborIntMargConsumerType, and TractableBufferStockConsumerType have been improved and expanded. #1743
- Handling of income shocks for model "newborns" has been made consistent across models, with transitory shocks optional. #1760
- Tests added to handle a variety of unusual corner cases. #1761
- Computing expectations now always uses
expected; if the function cannot accept vector arguments, passvectorized=False. #1763 - Matrix transition methods (including HA-SSJ) now support multi-exponential grids, as well as fully custom grids. #1762
HARK.interpolationrefactored to reduce repetition and code clutter. #1765- Small documentation notebook for life-cycle HA-SSJ construction has been added. #1718
HARK.simulatorand experimental Monte Carlo submodule refactored to reduce repetition. #1766HARK.distributionsrefactored to reduce repetition and improve structures. #1767- Additional refactoring in
Labeled,SSJutils,utilities, andmetricto reduce code repetition. #1768