diff options
| author | Tyler <tyler@tylerhoang.xyz> | 2026-04-03 19:01:53 -0700 |
|---|---|---|
| committer | Tyler <tyler@tylerhoang.xyz> | 2026-04-03 19:01:53 -0700 |
| commit | ba3fa0002205e6f15dbcd59b50d81715410547d3 (patch) | |
| tree | 13ec5da22fb81121bd4a43df5d4033a6b821ad14 /services | |
| parent | ccfbce79a66b2d8aa136fddbed7c61c7436f2733 (diff) | |
Show uncapped historical FCF growth
Diffstat (limited to 'services')
| -rw-r--r-- | services/valuation_service.py | 19 |
1 files changed, 16 insertions, 3 deletions
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( |
