Skip to content

fix the DCF terminal_value with Gordon Growth Model #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/agents/warren_buffett.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ def calculate_intrinsic_value(financial_line_items: list) -> dict[str, any]:
growth_rate = 0.05 # Conservative 5% growth
discount_rate = 0.09 # Typical ~9% discount rate
terminal_multiple = 12
terminal_growth_rate = 0.02 # Terminal growth rate (typically close to the long-term GDP growth rate)
projection_years = 10

# Sum of discounted future owner earnings
Expand All @@ -365,8 +366,9 @@ def calculate_intrinsic_value(financial_line_items: list) -> dict[str, any]:
future_value += present_value

# Terminal value
terminal_value = (owner_earnings * (1 + growth_rate) ** projection_years * terminal_multiple) / ((1 + discount_rate) ** projection_years)
terminal_value = (owner_earnings * (1 + growth_rate) ** projection_years * (1 + terminal_growth_rate) / (discount_rate - terminal_growth_rate)) / ((1 + discount_rate) ** projection_years)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be:

terminal_value = (
    owner_earnings * (1 + growth_rate) ** projection_years
    * terminal_growth_rate / (discount_rate - terminal_growth_rate)
) / ((1 + discount_rate) ** projection_years)

if you want to use the Gordon Growth model!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for replying. I did some research which supports my point including https://stablebread.com/warren-buffett-intrinsic-value/ and https://www.investopedia.com/terms/g/gordongrowthmodel.asp.

FV of TV = FCFn × (1 + g) / (r - g)
FV of TV = future value of terminal value
FCFn = Free cash flow for the last 12 months of the forecast growth period
r = discount rate (required rate of return)
g = estimated annual terminal growth rate


# Calculate intrinsic value
intrinsic_value = future_value + terminal_value

return {
Expand All @@ -376,6 +378,7 @@ def calculate_intrinsic_value(financial_line_items: list) -> dict[str, any]:
"growth_rate": growth_rate,
"discount_rate": discount_rate,
"terminal_multiple": terminal_multiple,
"terminal_growth_rate": terminal_growth_rate,
"projection_years": projection_years,
},
"details": ["Intrinsic value calculated using DCF model with owner earnings"],
Expand Down