AI Berkshire Three-Scenario Valuation Model: Optimistic, Neutral, and Pessimistic Projections
AI Berkshire's three-scenario valuation model calculates target stock prices using optimistic (bull), neutral (base), and pessimistic (bear) assumptions for EPS growth and P/E multiples, providing a risk-adjusted range for investment decisions.
The three-scenario valuation model is a core analytical engine in the AI Berkshire investment framework. Implemented in the tools/financial_rigor.py module of the xbtlin/ai-berkshire repository, this model enables investors to project future valuations across bull, base, and bear cases, ensuring precise arithmetic using Python's Decimal type for financial accuracy.
How the Three-Scenario Valuation Model Works
Core Inputs and Parameters
The model accepts specific financial metrics through the three_scenario_valuation function in tools/financial_rigor.py. Key inputs include:
current_price: The current share pricecurrent_eps: Current earnings per share (TTM)shares_billion: Total shares outstanding in billionsgrowth_optimistic,growth_neutral,growth_pessimistic: Three annual EPS growth ratespe_optimistic,pe_neutral,pe_pessimistic: Three target P/E multiplesyears: Projection horizon (default 3 years)currency: Currency denomination for reporting
Exact Arithmetic and Calculation Logic
All numeric inputs are converted to Decimal via the exact() helper to eliminate floating-point drift. For each scenario, the model performs two core calculations:
- Compounds EPS over the projection period:
future_eps = eps × (1+growth)^years - Calculates target price:
target_price = future_eps × target_pe
The function then computes the percentage change versus the current price, outputting a concise table showing the upside or downside for each scenario.
Implementation in AI Berkshire Skills
The model integrates directly into AI Berkshire's skill system. According to skills/investment-team.md (line 68), the tool is invoked via CLI for investment team workflows. Similar integrations appear in skills/investment-research.md (line 165) for research reports, skills/portfolio-review.md (line 106) for portfolio analysis, and skills/investment-checklist.md (line 148) for valuation validation.
CLI Usage and Python API
Command-Line Interface
The primary interface exposes the model through a three-scenario subcommand:
python3 tools/financial_rigor.py three-scenario \
--price 510 --eps 23.5 --shares 9.11 \
--growth 0.15 0.08 0.00 \
--pe 25 20 15 \
--years 3 --currency HKD
Direct Python Integration
For custom scripts or Jupyter notebooks, import the function directly:
from tools.financial_rigor import three_scenario_valuation
result = three_scenario_valuation(
current_price=120,
current_eps=5,
shares_billion=5,
growth_optimistic=0.20,
growth_neutral=0.10,
growth_pessimistic=0.00,
pe_optimistic=30,
pe_neutral=22,
pe_pessimistic=15,
years=3,
currency="USD"
)
Risk-Adjusted Decision Making
The three-scenario approach aligns with AI Berkshire's "four-master" framework, mapping different investment perspectives to specific scenarios. The optimistic scenario reveals upside potential under favorable conditions, the neutral scenario establishes a realistic baseline, and the pessimistic scenario quantifies downside risk. This transparency allows users to audit assumptions independently by adjusting growth rates and target P/E multiples.
Summary
- The three-scenario valuation model in AI Berkshire projects stock prices using optimistic, neutral, and pessimistic assumptions for EPS growth and P/E ratios.
- Located in
tools/financial_rigor.py, thethree_scenario_valuationfunction usesDecimalarithmetic to ensure exact financial calculations. - The model is integrated across multiple skills including investment-team, investment-research, and portfolio-review workflows.
- Both CLI and Python API interfaces support flexible integration into custom investment analysis pipelines.
Frequently Asked Questions
How does AI Berkshire handle precision in financial calculations?
The model converts all numeric inputs to Decimal objects via an exact() utility function, preventing floating-point errors that commonly occur in financial software. This ensures calculations are auditable and reproducible, as noted in the source code comment "所有计算使用精确十进制, 结果可审计复现" (line 60).
What inputs are required for the three-scenario valuation?
Users must provide current price, EPS, shares outstanding (in billions), three growth rates (optimistic/neutral/pessimistic), three target P/E multiples, projection years, and currency. These parameters feed into the three_scenario_valuation function in tools/financial_rigor.py.
Can I use the model outside of AI Berkshire's skill system?
Yes. While the Skills framework in files like skills/investment-team.md wraps the functionality for conversational AI, you can import three_scenario_valuation directly from tools/financial_rigor.py or use the standalone CLI command python3 tools/financial_rigor.py three-scenario.
Why does the model use three scenarios instead of a single target price?
Multiple scenarios provide risk-adjusted decision-making by explicitly quantifying upside potential (bull), realistic expectations (base), and downside risk (bear). This approach aligns with value investing principles and allows investors to visualize the range of possible outcomes rather than relying on a single point estimate.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →