Skip to main content

Household Portfolio Decision Logic

ABMLP-X Household portfolio decision behavioural logic: April 2024.

interest-assets.py
# Utility: Catch divide by zero error.
def zero_division(n, d):
return n / d if d else 0

def interest_assets(self, central_bank):
"""
The proportion of wealth a household agent will allocate to
interest-bearing money assets. Reference doc:
'Do the Rich Save More?' Short answer: Yes, they do.

Dynan, Karen E.; Skinner, Jonathan; and Zeldes, Stephen P.,
"Do the Rich Save More?" (2000).
Open Dartmouth: Faculty Open Access Articles. 1769.
https://digitalcommons.dartmouth.edu/facoa/1769
"""
change_in_base_rate = (zero_division(central_bank.base_rate
- central_bank.base_rate_last_step,
central_bank.base_rate_last_step)
* 100)

wealth_diff_ratio = (zero_division(self.wealth
- Household.average_wealth, Household.average_wealth))

if self.is_employed:
if wealth_diff_ratio >= 1:
prop_assets_this = ((self.wealth * Decimal('0.40'))
* (1 + zero_division(change_in_base_rate, 100)))
elif wealth_diff_ratio >= 0.5 and wealth_diff_ratio < 1:
prop_assets_this = ((self.wealth * Decimal('0.30'))
* (1 + zero_division(change_in_base_rate, 100)))
elif wealth_diff_ratio >= 0 and wealth_diff_ratio < 0.5:
prop_assets_this = ((self.wealth * Decimal('0.20'))
* (1 + zero_division(change_in_base_rate, 100)))
else:
prop_assets_this = ((self.wealth * Decimal('0.01'))
* (1 + zero_division(change_in_base_rate, 100)))
else: # Agent is unemployed in this step.
if wealth_diff_ratio >= 1:
prop_assets_this = ((self.wealth * Decimal('0.25'))
* (1 + zero_division(change_in_base_rate, 100)))
elif wealth_diff_ratio >= 0.5 and wealth_diff_ratio < 1:
prop_assets_this = ((self.wealth * Decimal('0.10'))
* (1 + zero_division(change_in_base_rate, 100)))
elif wealth_diff_ratio >= 0 and wealth_diff_ratio < 0.5:
prop_assets_this = ((self.wealth * Decimal('0.05'))
* (1 + zero_division(change_in_base_rate, 100)))
else:
prop_assets_this = ((self.wealth * Decimal('0.01'))
* (1 + zero_division(change_in_base_rate, 100)))

return prop_assets_this
bond-price-expectations.py
# Utility: Catch divide by zero error.
def zero_division(n, d):
return n / d if d else 0

""" G&L p142:
Portfolio Decision: Bills vs bonds vs central bank (money) deposits.
"... We have further assumed that it is the expected rate of returns on bonds, ERrbl,
rather than the yield on bonds, rbL, that enters into the determination of portfolio choice.
We note that indeed portfolio decisions of households are forward-looking."
"""
# *** Bond Price Expectations Logic ***
self.expected_coupon_rate = government.coupon_rate # Freeze bond price expectations.

"""
Agent Bond Price Expectations:
G&L p148: ERrbL = rbL + χ * ((PebL - PbL) / PbL)

'self.expected_bond_price = government.bond_price': Freeze expectations:
A household would expect the current bond price to remain the same in the next period.
"""

# Use the int rate from the previoius step and the expected coupon rate
# to calculate the expected price of a long-term bond.
self.expected_bond_price = zero_division(self.expected_coupon_rate, central_bank.base_rate)

self.expected_bond_yield = (government.bond_yield
+ (self.chi * zero_division(self.expected_bond_price
- government.bond_price,
government.bond_price)))

# Expected capital gains or losses.
self.expected_capital_gains = (self.chi
* ((self.expected_bond_price - government.bond_price)
* self.bonds_demanded))

Proportion Bonds

proportion-bonds.py
# Utility: Catch divide by zero error.
def zero_division(n, d):
return n / d if d else 0

def prop_bonds(self, interest_assets, government):
""" Balance the portfolio of interest assets between bills and bonds. """
prop_assets = interest_assets

change_in_bond_yield = (zero_division(self.expected_bond_yield
- government.bond_yield, government.bond_yield)
* 100)

wealth_diff_ratio = (zero_division(self.wealth
- Household.average_wealth, Household.average_wealth))

if self.is_employed:
if wealth_diff_ratio >= 1:
prop_bonds_this = ((prop_assets * Decimal('0.90'))
* (1 + zero_division(change_in_bond_yield, 100)))
elif wealth_diff_ratio >= 0.5 and wealth_diff_ratio < 1:
prop_bonds_this = ((prop_assets * Decimal('0.70'))
* (1 + zero_division(change_in_bond_yield, 100)))
elif wealth_diff_ratio >= 0 and wealth_diff_ratio < 0.5:
prop_bonds_this = ((prop_assets * Decimal('0.30'))
* (1 + zero_division(change_in_bond_yield, 100)))
else:
prop_bonds_this = ((prop_assets * Decimal('0.20'))
* (1 + zero_division(change_in_bond_yield, 100)))
else: # Agent is unemployed in this step.
if wealth_diff_ratio >= 1:
prop_bonds_this = ((prop_assets * Decimal('0.70'))
* (1 + zero_division(change_in_bond_yield, 100)))
elif wealth_diff_ratio >= 0.5 and wealth_diff_ratio < 1:
prop_bonds_this = ((prop_assets * Decimal('0.50'))
* (1 + zero_division(change_in_bond_yield, 100)))
elif wealth_diff_ratio >= 0 and wealth_diff_ratio < 0.5:
prop_bonds_this = ((prop_assets * Decimal('0.20'))
* (1 + zero_division(change_in_bond_yield, 100)))
else:
prop_bonds_this = ((prop_assets * Decimal('0.10'))
* (1 + zero_division(change_in_bond_yield, 100)))

return prop_bonds_this