Assets¶
This module manages all assets using various classes and functions: pension plans, individual savings (registered and unregistered), housing, business assets. It uses the contributions and room used as inputs as well as returns generated in the Macro module, and it updates all asset-related variables as the simulation progresses.
- class CPR.assets.ContributionRoom(init_room_rrsp, init_room_tfsa)¶
This class manages contribution room for TFSAs and RRSPs.
All amounts are nominal.
- Parameters
init_room_rrsp (float) – initial RRSP contribution room available
init_room_tfsa (float) – initial TFSA contribution room available
- compute_contributions(p, year, common, prices)¶
Function to update contribution room for RRSPs and TFSAs, using the 2 other functions below (which themselves call the other functions of the class).
- update_rrsp_room(p, year, common)¶
Function to update RRSP contribution room.
- Parameters
p (Person) – instance of the class Person
year (int) – year
common (Common) – instance of the class Common
- update_tfsa_room(p, year, common)¶
Function to update TFSA contribution room.
- Parameters
p (Person) – instance of the class Person
year (int) – year
common (Common) – instance of the class Common
- adjust_db_contributions(p, year, common)¶
Function to adjust RRSP contribution room to DB RPP contributions.
- Parameters
p (Person) – instance of the class Person
year (int) – year
common (Common) – instance of the class Common
- adjust_dc_contributions(p, year)¶
Function to adjust RRSP contribution room to DC RPP contributions.
If contribution room is insufficent for the intended/planned RRSP contributions, the “excess” contributions are channeled to TFSA.
- Parameters
p (Person) – instance of the class Person
year (int) – year
- adjust_employees_contributions(p)¶
Function to compute employee contributions to DC RPPs (later used to caculate taxes).
- Parameters
p (Person) – instance of the class Person
- adjust_rrsp_contributions(acc, p, year)¶
Function to adjust RRSP contribution for contributions other than to RPPs.
If contribution room is insufficent for the intended/planned RRSP contributions, the “excess” contributions are channeled to TFSA.
- Parameters
acc (str) – type of account
p (Person) – instance of the class Person
year (int) – year
- adjust_tfsa_contributions(p, year, common, prices)¶
Function to adjust TFSA contribution room to TFSA contributions (including “excess” DC RPP and RRSP contributions).
If contribution room is insufficent for the intended/planned TFSA contributions, the “excess” contributions are channeled to unregistered accounts.
- adjust_rrif(p, year, common, prices)¶
Function to adjust DC RPP and RRSP accounts to mandatory RRIF withdrawals (RRIFs are not separately modelled in this version).
- adjust_unreg_contributions(p, year)¶
Function to adjust contributions to unregistered accounts for “excess” TFSA contributions channeled to them.
- Parameters
p (Person) – instance of the class Person
year (int) – year
- reset()¶
Reset RRSP and TFSA contribution rooms to their inital values.
- class CPR.assets.FinAsset(p, hh, acc)¶
This class manages registered accounts. All amounts are nominal.
- Parameters
- update(d_returns, year, common, prices)¶
Function to update the balance to account for contributions, withdrawals, and returns.
- Parameters
d_returns (dict) – dictionary of returns
year (int) – year
common (Common) – instance of the class Common
prices (Prices) – instance of the class Prices
- rate(d_returns, year)¶
Function to compute the rate of return given the mix of assets in the account.
- Parameters
d_returns (dict) – dictionary of returns
year (int) – year
- Returns
Rate of return (net of fees).
- Return type
float
- rrif_withdrawal(p, common)¶
Function to manage mandatory RRIF withdrawals.
- Parameters
p (Person) – instance of the class Person
common (Common) – instance of the class Common
- Returns
Amount of mandatory withdrawal.
- Return type
float
- liquidate()¶
Function to liquidate an account, setting balance, contributions and withdrawals to zero.
- Returns
Amount from liquidation (before taxes).
- Return type
float
- reset()¶
Reset the balance and withdrawal to its initial balance.
- class CPR.assets.UnregAsset(p, hh, prices)¶
This class manages unregistered accounts.
All amounts are nominal.
- Parameters
- update(d_returns, year, common, prices)¶
Function to update the balance for contributions, withdrawals and returns.
- Parameters
d_returns (dict of float) – dictionary of returns
year (int) – year
common (Common) – instance of the class Common
prices (Prices) – instance of the class Prices
- compute_income(d_returns, year)¶
Function to compute new capital gains and taxable income (dividends and interests).
- Parameters
d_returns (dict of float) – dictionary of returns
year (int) – year
- rate(d_returns, year)¶
Function that computes the rate of return given the mix of assets in account.
- Parameters
d_returns (dict of float) – dictionary of returns
year (int) – year
- Returns
Rate of return (net of fees).
- Return type
float
- update_balance()¶
Function to update to balance and separate between non-taxable funds (i.e. previous post-tax balance), capital gains, dividends, and interests.
- prepare_withdrawal()¶
Function to separate a withdrawal from the balance at the end of the period, and separately identify non-taxable funds, capital gains, dividends, and interests.
- adjust_income()¶
Function to adjust investment income (dividends and interests) for withdrawals.
- adjust_cap_losses(realized_cap_gains)¶
Function to compute capital losses from previous years used for deduction against capital gains, and adjust realized capital losses accordingly.
- Parameters
realized_cap_gains (float) – capital gains
- Returns
Capital losses (to be deducted).
- Return type
float
- adjust_final_balance()¶
Function that adjusts the final balance for withdrawals, dividends and interests.
- liquidate()¶
Function to liquidate the account and adjust capital losses.
- reset()¶
Function to reset the balance, capital gains, and withdrawals to their initial values.
- class CPR.assets.RppDC(p, common)¶
This class manages DC RPPs.
All amounts are nominal.
- Parameters
p (Person) – instance of the class Person
common (Common) – instance of the class Common
- class CPR.assets.RppDB(p)¶
This class manages DB RPPs.
All amounts are nominal.
- Parameters
p (Person) – instance of the class Person
- compute_benefits(p, common)¶
Function that computes RPP DB benefits and adjusts them for CPP/QPP integration.
If RPP benefits are smaller than CPP/QPP benefits, RPP benefits are set to zero once the receipt of CPP/QPP retirement benefits begins.
- Parameters
p (Person) – instance of the class Person
common (Common) – instance of the class Common
- adjust_for_penalty(p, common)¶
Function to compute a penalty for individuals who begin to receive DB RPP benefits “early”, i.e. before they accumulate the maximum number of years of service, if they are younger than the age at which benefits can start without penalty (the “early retirement age”).
By default, the penalty applies to those who begin RPP benefits receipt before reaching 35 years of service and before age 62. These values can be modified.
- Parameters
p (Person) – instance of the class Person
common (Common) – instance of the class Common
- compute_cpp_adjustment(p, common)¶
Function to compute an adjustment (reduction) to DB RPP benefits to account for CPP/QPP integration.
- Parameters
p (Person) – instance of the class Person
common (Common) – instance of the class Common
- Returns
Amount of benefit adjustment for CPP/QPP integration.
- Return type
float
- reset()¶
Function that resets the benefits and contribution rates to their initial values.
- class CPR.assets.RealAsset(d_hh, resid)¶
This class manages housing and residences.
All amounts are nominal.
- Parameters
d_hh (dict of float) – dictionary containing values of residences
resid (str) – primary or secondary residence
- update(growth_rates, year, prices)¶
Function to update the balance (residence values) for growth in price.
- Parameters
growth_rates (dict) – nominal return to housing (capital gains)
year (int) – year
prices (Prices) – instance of the class Prices
- liquidate()¶
Function to liquidate the asset, compute capital gains if they apply, and set balance to zero.
- Returns
Amount from asset liquidation (before taxes).
- Return type
float
- reset()¶
Function to reset residence value to its initial value and set capital gains to zero.
- class CPR.assets.Business(d_hh)¶
This class manages a business (as an asset owned by the houshehold).
All amounts are nominal.
- Parameters
d_hh (dict of float) – dictionary containing value of business
- update(d_business_returns, year, prices)¶
Function to update the balance and dividends.
- Parameters
d_business_returns (dict) – returns on business assets
year (int) – year
prices (Prices) – instance of the class Prices
- liquidate(common)¶
Function to liquidate account (business assets), compute capital gains, and set balance to zero.
- Parameters
common (Common) – instance of the class Common
- Returns
Selling price of the business assets.
- Return type
float
- reset()¶
Reset business value and capital gains to their initial values.