Monte Carlo Intrinsic Valuation
Calculate the distribution of the intrinsic value per share when the inputs of the Discounted Cash Flow model are uncertain. A single DCF value hides how sensitive it is to its assumptions; here the growth rate, the perpetual growth rate and the discount rate are drawn from normal distributions around their expected values in every simulation, and the DCF of get_intrinsic_valuation is calculated for each draw. The spread of the outcomes, and the probability that the value exceeds the share price, show how robust the conclusion is.
Draws in which the discount rate does not exceed the perpetual growth rate by at least half a percentage point are redrawn, as the terminal value is undefined there.
For more information, see the following book:
- Damodaran, A. (2012). “Investment Valuation: Tools and Techniques for Determining the Value of Any Asset.” Wiley, 3rd edition, chapter 33 (probabilistic approaches).
Also known as: Monte Carlo DCF, probabilistic valuation, DCF simulation.
Monte Carlo Intrinsic Valuation in Python or via the MCP
Install the Finance Toolkit with:
pip install financetoolkit -U
Then call get_monte_carlo_intrinsic_valuation as shown below.
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2021-01-01",
end_date="2025-12-31",
)
toolkit.models.get_monte_carlo_intrinsic_valuation(
growth_rate=0.08, weighted_average_cost_of_capital=0.09
)
Or, after setting up the Finance Toolkit MCP, ask:
How is the discounted cash flow value of Apple and Microsoft distributed in a Monte Carlo simulation with 8% growth and a 9% WACC, and how likely is each to be undervalued?
Which returns:
| Mean | Standard Deviation | 5th Percentile | 25th Percentile | 50th Percentile | 75th Percentile | 95th Percentile | Share Price | Probability Undervalued | |
|---|---|---|---|---|---|---|---|---|---|
| AAPL | 113.466 | 24.52 | 82.0179 | 96.6542 | 109.564 | 125.871 | 158.283 | 271.86 | 0.0004 |
| MSFT | 182.735 | 40.0623 | 131.353 | 155.267 | 176.361 | 203.002 | 255.96 | 483.62 | 0.0002 |
Parameters
get_monte_carlo_intrinsic_valuation accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
growth_rate | float | dict[str, float] | The expected yearly growth over the projection periods, one number or a number per ticker. | 0.03 |
growth_rate_volatility | float | The standard deviation of the growth rate. Defaults to 0.02. | 0.02 |
perpetual_growth_rate | float | dict[str, float] | The expected growth after the projection periods. Defaults to 0.025. | 0.02 |
perpetual_growth_rate_volatility | float | Its standard deviation. Defaults to 0.005. | 0.005 |
weighted_average_cost_of_capital | float | dict[str, float] | None | The expected discount rate. Defaults to None, which uses the latest Weighted Average Cost of Capital of each company, calculated over a year (the last 4 quarters with quarterly data) whatever trailing the cash flows use, as the rate is a yearly one. | 0.08 |
weighted_average_cost_of_capital_volatility | float | Its standard deviation. Defaults to 0.01. | 0.01 |
periods | int | The number of projection periods. Defaults to 5. | 5 |
simulations | int | The number of simulations. Defaults to 10,000. | 1000 |
cash_flow_type | str | The cash flow to project: “Free Cash Flow to Firm” (see get_free_cash_flow_to_firm), the cash flow to debt and equity holders that the WACC discounts into an enterprise value; or “Free Cash Flow” or “Operating Cash Flow” as reported, which are after interest (cash flows to equity), so that discounting them at the WACC and subtracting the debt counts the cost of debt twice. Defaults to “Free Cash Flow to Firm”. | "Operating Cash Flow" |
trailing | int | None | Sum the cash flow over this many periods (e.g. 4 quarters) instead of taking the latest one. Defaults to None, which sums the last 4 quarters (a trailing twelve months) for quarterly data and takes the latest year otherwise, as the projection periods are years. | 4 |
seed | int | None | The seed of the random numbers, so that results can be reproduced. Defaults to 0; None gives different draws every time. | 42 |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the Toolkit’s rounding. | 2 |