Core Functions
derive_prices
Target internal rate of return as a decimal (e.g., 0.10 for 10%)
Exit capitalization rate as a decimal (e.g., 0.06 for 6%)
Net operating income at purchase (NOI₀)
Expected annual NOI growth rate as a decimal (e.g., 0.03 for 3%)
Holding period in years
The calculated purchase price based on DCF analysis
The expected sale price at the end of the holding period
derive_irr
Actual purchase price of the property
Observed sale price at end of holding period
Entry capitalization rate as a decimal (e.g., 0.06 for 6%)
Annual NOI growth rate as a decimal
Holding period in years
The implied IRR as a decimal
scipy.optimize.brentq) to solve the DCF equation for IRR.
derive_noi_growth
Target internal rate of return as a decimal
Exit capitalization rate as a decimal
Observed entry price
Entry capitalization rate as a decimal
Holding period in years
Lower bound for NOI growth search (e.g., -10%)
Upper bound for NOI growth search (e.g., 20%)
Implied annual NOI growth rate as a decimal
derive_irr_df
DataFrame containing columns:
key, entry_price, exit_price, entry_date, exit_dateDictionary mapping years to entry cap rates:
{year: cap_rate}Dictionary mapping years to NOI growth rates:
{year: noi_growth}Original DataFrame with added columns:
holding_period: Holding period in years (int)implied_irr: Calculated IRR for each transactionentry_year: Year of purchaseentry_cap_rate: Cap rate used for the entry yearentry_noi: Derived NOI at purchase
Capitalization Rate Functions
calculate_noi
Property price
Capitalization rate as a decimal
Net operating income:
price × cap_ratecalculate_cap_rate_growth
NOI = Sale Price × Cap Rate, the percentage change in cap rate is approximately:
Annual percentage changes in sale price as decimals (e.g.,
[0.01, 0.015, 0.02] for 1%, 1.5%, 2%)Annual percentage changes in NOI as decimals
Annual percentage changes in cap rate as decimals
calculate_noi_growth
Annual percentage changes in sale price as decimals
Annual percentage changes in cap rate as decimals
Annual percentage changes in NOI as decimals
Usage Example
Mathematical Background
DCF Model Assumptions
- Cash Flows: Annual NOI grows at constant rate
g - Discount Rate: All cash flows discounted at IRR
- Exit Value: Property sold at NOI/cap_rate formula
- Holding Period: Integer number of years
Net Present Value Equation
scipy.optimize.brentq for numerical root-finding when solving for IRR or NOI growth.