From ba3fa0002205e6f15dbcd59b50d81715410547d3 Mon Sep 17 00:00:00 2001 From: Tyler Date: Fri, 3 Apr 2026 19:01:53 -0700 Subject: Show uncapped historical FCF growth --- services/valuation_service.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'services/valuation_service.py') diff --git a/services/valuation_service.py b/services/valuation_service.py index 1230aa5..0b8dfde 100644 --- a/services/valuation_service.py +++ b/services/valuation_service.py @@ -12,9 +12,9 @@ def _cap_growth(value: float) -> float: return max(GROWTH_FLOOR, min(GROWTH_CAP, float(value))) -def compute_historical_growth_rate(fcf_series: pd.Series) -> float | None: +def _compute_median_historical_growth_rate(fcf_series: pd.Series) -> float | None: """ - Return a capped median YoY FCF growth rate from historical data. + Return the raw median YoY FCF growth rate from historical data. Notes: - skips periods with near-zero prior FCF @@ -40,7 +40,20 @@ def compute_historical_growth_rate(fcf_series: pd.Series) -> float | None: if not growth_rates: return None - return _cap_growth(float(np.median(growth_rates))) + return float(np.median(growth_rates)) + + +def compute_historical_growth_rate(fcf_series: pd.Series) -> float | None: + """Return a capped median YoY FCF growth rate from historical data.""" + raw_growth = _compute_median_historical_growth_rate(fcf_series) + if raw_growth is None: + return None + return _cap_growth(raw_growth) + + +def compute_raw_historical_growth_rate(fcf_series: pd.Series) -> float | None: + """Return the uncapped median YoY FCF growth rate from historical data.""" + return _compute_median_historical_growth_rate(fcf_series) def run_dcf( -- cgit v1.3-2-g0d8e