Advanced Module¶
??? example "black_scholes"
from startup_valuation.advanced import black_scholes
result = black_scholes(
underlying=20_000_000, strike=5_000_000,
risk_free_rate=0.05, volatility=0.40, time_to_maturity=1.0,
)
print(f"Option value: ${result.value:,.0f}") # $15,244,009
??? example "binomial_tree"
from startup_valuation.advanced import binomial_tree
result = binomial_tree(
underlying=100, strike=100, risk_free_rate=0.05,
volatility=0.20, time_to_maturity=1.0, steps=3,
)
print(f"Binomial value: ${result.value:.2f}")
??? example "binomial_valuation"
from startup_valuation.advanced import binomial_valuation
result = binomial_valuation(
underlying=20_000_000, strike=5_000_000,
risk_free_rate=0.05, volatility=0.40, time_to_maturity=1.0,
steps=50,
)
print(f"High-res binomial: ${result.value:,.0f}")
??? example "monte_carlo_valuation"
from startup_valuation.advanced import monte_carlo_valuation
from startup_valuation.types import Distribution
result = monte_carlo_valuation(
market_size_dist=Distribution("normal", {"mean": 1_000_000_000, "sd": 200_000_000}),
market_share_dist=Distribution("uniform", {"min": 0.01, "max": 0.05}),
margin_dist=Distribution("triangular", {"min": 0.20, "mode": 0.40, "max": 0.60}),
exit_multiple=8, discount_rate=0.15, years=5, num_simulations=10_000,
)
print(f"Monte Carlo: ${result.value:,.0f}")
??? example "scenario_analysis"
from startup_valuation.advanced import scenario_analysis
from startup_valuation.types import Scenario
scenarios = [
Scenario("bull", 0.20, 10_000_000),
Scenario("base", 0.60, 5_000_000),
Scenario("bear", 0.20, 1_000_000),
]
result = scenario_analysis(scenarios)
print(f"Expected value: ${result.value:,.0f}") # $5,200,000
??? example "ltv_cac_valuation"
from startup_valuation.advanced import ltv_cac_valuation
from startup_valuation.types import Distribution
result = ltv_cac_valuation(
ltv_dist=Distribution("normal", {"mean": 5_000, "sd": 1_000}),
cac_dist=Distribution("normal", {"mean": 500, "sd": 100}),
market_size_dist=Distribution("normal", {"mean": 100_000, "sd": 20_000}),
num_simulations=10_000,
)
print(f"LTV/CAC valuation: ${result.value:,.0f}")
startup_valuation.advanced
¶
Advanced valuation techniques: Black-Scholes, Binomial, Monte Carlo, Scenario Analysis.
Chapter 4: Advanced Techniques
Classes¶
Functions:¶
black_scholes(underlying, strike, risk_free_rate, volatility, time_to_maturity)
¶
Calculate call option value using Black-Scholes model.
Formula: C = N(d₁)S - N(d₂)Ke^(-rT) where: d₁ = [ln(S/K) + (r + σ²/2)T] / [σ√T] d₂ = d₁ - σ√T
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
underlying
|
float
|
Current price of underlying asset (S). |
required |
strike
|
float
|
Strike price (K). |
required |
risk_free_rate
|
float
|
Risk-free rate (r). |
required |
volatility
|
float
|
Volatility of underlying (σ). |
required |
time_to_maturity
|
float
|
Time to maturity in years (T). |
required |
Returns:
| Type | Description |
|---|---|
ValuationResult
|
ValuationResult with call option value. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If underlying, strike, volatility, or time_to_maturity are non-positive. |
Notes
The Black-Scholes model prices a European call option assuming the underlying follows geometric Brownian motion:
$$C = S \cdot N(d_1) - K e^{-rT} \cdot N(d_2)$$
$$d_1 = \frac{\ln(S/K) + (r + \sigma^2/2)T}{\sigma\sqrt{T}}$$
$$d_2 = d_1 - \sigma\sqrt{T}$$
$$N(d)$$ is the standard normal CDF computed via scipy.stats.norm.cdf.
Assumptions: European exercise only, constant volatility and risk-free rate, no dividends, continuous trading, no transaction costs.
References
Startup Valuation textbook, Chapter 4, Section 4.1. Black, F. & Scholes, M. (1973). The Pricing of Options and Corporate Liabilities. Journal of Political Economy, 81(3), 637-654.
See Also
binomial_valuation : Discrete-time alternative converging to Black-Scholes. monte_carlo_valuation : Probabilistic approach for complex payoffs. Theory: https://github.com/simonmak-ascent/startup-valuation/wiki/Advanced-Methods
Example
result = black_scholes(20_000_000, 5_000_000, 0.05, 0.40, 1.0) round(result.value / 1_000_000, 2) 15.24
Source code in src/startup_valuation/advanced.py
binomial_tree(underlying, strike, risk_free_rate, volatility, time_to_maturity, steps=3)
¶
Value an option using a binomial tree model.
Formulas
u = e^(σ√Δt) d = e^(-σ√Δt) p = (e^(rΔt) - d) / (u - d)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
underlying
|
float
|
Current price of underlying asset. |
required |
strike
|
float
|
Strike price. |
required |
risk_free_rate
|
float
|
Risk-free rate. |
required |
volatility
|
float
|
Volatility. |
required |
time_to_maturity
|
float
|
Time to maturity in years. |
required |
steps
|
int
|
Number of time steps. |
3
|
Returns:
| Type | Description |
|---|---|
ValuationResult
|
ValuationResult with option value. |
Notes
The binomial tree models asset price as discrete up/down movements. At each step, price can go up (factor u) or down (factor d):
$$u = e^{\sigma\sqrt{\Delta t}}, \quad d = e^{-\sigma\sqrt{\Delta t}}$$
$$p = \frac{e^{r\Delta t} - d}{u - d}$$
Backward induction computes option value from terminal nodes. Converges to Black-Scholes as steps → ∞.
References
Startup Valuation textbook, Chapter 4, Section 4.2. Cox, Ross & Rubinstein (1979). Option Pricing: A Simplified Approach. Journal of Financial Economics, 7(3), 229-263.
See Also
black_scholes : Closed-form European option pricing. binomial_valuation : High-resolution variant (50 steps). Theory: https://github.com/simonmak-ascent/startup-valuation/wiki/Advanced-Methods
Source code in src/startup_valuation/advanced.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
monte_carlo_valuation(market_size_dist, market_share_dist, margin_dist, exit_multiple, discount_rate, years, num_simulations=10000, seed=None)
¶
Monte Carlo simulation for startup valuation.
Formula: PV = (Market Size × Market Share × Margin × Multiple) / (1 + r)^n
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
market_size_dist
|
Distribution
|
Distribution for market size. |
required |
market_share_dist
|
Distribution
|
Distribution for market share. |
required |
margin_dist
|
Distribution
|
Distribution for profit margin. |
required |
exit_multiple
|
float
|
Exit multiple. |
required |
discount_rate
|
float
|
Discount rate. |
required |
years
|
float
|
Years to exit. |
required |
num_simulations
|
int
|
Number of simulations. |
10000
|
seed
|
int | None
|
Random seed for reproducibility. |
None
|
Returns:
| Type | Description |
|---|---|
ValuationResult
|
ValuationResult with mean, percentiles, and full distribution. |
Notes
Monte Carlo simulation estimates valuation by sampling from input distributions and computing the DCF formula for each sample:
$$PV_i = \frac{S_i \times M_i \times P_i \times \text{Multiple}}{(1 + r)^n}$$
Results include: mean, standard deviation, 5th/50th/95th percentiles, and the full array of simulated values.
Supports Normal, Uniform, and Triangular distributions.
References
Startup Valuation textbook, Chapter 4, Section 4.3. Boyle, P. (1977). Options: A Monte Carlo Approach. Journal of Financial Economics, 4(3), 323-338.
See Also
scenario_analysis : Discrete probability-weighted scenarios. black_scholes : Closed-form alternative for option pricing. Theory: https://github.com/simonmak-ascent/startup-valuation/wiki/Advanced-Methods
Source code in src/startup_valuation/advanced.py
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | |
scenario_analysis(scenarios)
¶
Calculate expected value across scenarios.
Formula: E[V] = Σ pᵢ × Vᵢ
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenarios
|
list[Scenario]
|
List of scenarios with name, probability, and value. |
required |
Returns:
| Type | Description |
|---|---|
ValuationResult
|
ValuationResult with expected value. |
Example
scenarios = [ ... Scenario("bull", 0.20, 10_000_000), ... Scenario("base", 0.60, 5_000_000), ... Scenario("bear", 0.20, 1_000_000), ... ] result = scenario_analysis(scenarios) result.value 5200000.0
Source code in src/startup_valuation/advanced.py
ltv_cac_valuation(ltv_dist, cac_dist, market_size_dist, num_simulations=10000, seed=None)
¶
Valuation using LTV/CAC ratio with Monte Carlo.
Formula: Valuation = (LTV/CAC) × Market Size × 0.1
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ltv_dist
|
Distribution
|
Distribution for LTV. |
required |
cac_dist
|
Distribution
|
Distribution for CAC. |
required |
market_size_dist
|
Distribution
|
Distribution for market size. |
required |
num_simulations
|
int
|
Number of simulations. |
10000
|
seed
|
int | None
|
Random seed. |
None
|
Returns:
| Type | Description |
|---|---|
ValuationResult
|
ValuationResult with mean valuation. |
Source code in src/startup_valuation/advanced.py
binomial_valuation(underlying, strike, risk_free_rate, volatility, time_to_maturity, steps=50)
¶
Value a startup option using binomial tree with high resolution.
Formula: Same as binomial_tree with steps=50 for convergence to Black-Scholes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
underlying
|
float
|
Current value of startup. |
required |
strike
|
float
|
Liquidation preference or strike price. |
required |
risk_free_rate
|
float
|
Risk-free rate. |
required |
volatility
|
float
|
Volatility of startup value. |
required |
time_to_maturity
|
float
|
Time to exit in years. |
required |
steps
|
int
|
Number of time steps (default 50 for convergence). |
50
|
Returns:
| Type | Description |
|---|---|
ValuationResult
|
ValuationResult with option value. |
Example
result = binomial_valuation(20_000_000, 5_000_000, 0.05, 0.40, 1.0, 50) round(result.value / 1_000_000, 2) 15.24