Skip to content

Time Value Module

??? example "present_value"

from startup_valuation.tv import present_value

result = present_value(future_value=1_000_000, rate=0.10, periods=5)
print(f"Present value: ${result.value:,.0f}")  # $620,921

??? example "net_present_value"

from startup_valuation.tv import net_present_value

result = net_present_value(
    cash_flows=[-1_000_000, 300_000, 400_000, 500_000, 600_000],
    rate=0.10,
)
print(f"NPV: ${result.value:,.0f}")  # $348,941

??? example "annuity_present_value"

from startup_valuation.tv import annuity_present_value

result = annuity_present_value(payment=100_000, rate=0.08, periods=10)
print(f"Annuity PV: ${result.value:,.0f}")  # $671,008

startup_valuation.tv

Time value of money calculations.

Chapter 2: Mathematical Foundations — Time Value of Money

Classes

Functions:

present_value(future_value, rate, periods)

Calculate present value of a single future cash flow.

Formula: PV = C / (1 + r)^t

Parameters:

Name Type Description Default
future_value float

Future cash flow (C).

required
rate float

Discount rate (r).

required
periods float

Number of periods (t).

required

Returns:

Type Description
ValuationResult

ValuationResult with present value.

Raises:

Type Description
ValueError

If rate < -1.

Notes

Present value discounts a single future cash flow to today's dollars:

$$PV = \frac{C}{(1 + r)^t}$$

Foundation of all DCF and NPV calculations. Higher discount rates or longer time horizons reduce present value.

References

Startup Valuation textbook, Chapter 2, Section 2.2.

See Also

net_present_value : Sum of discounted cash flows. annuity_present_value : Perpetual or fixed-period payments.

Example

result = present_value(11000, 0.08, 1) round(result.value, 2) 10185.19

Source code in src/startup_valuation/tv.py
def present_value(future_value: float, rate: float, periods: float) -> ValuationResult:
    """Calculate present value of a single future cash flow.

    Formula: PV = C / (1 + r)^t

    Args:
        future_value: Future cash flow (C).
        rate: Discount rate (r).
        periods: Number of periods (t).

    Returns:
        ValuationResult with present value.

    Raises:
        ValueError: If rate < -1.

    Notes:
        Present value discounts a single future cash flow to today's dollars:

        $$PV = \\frac{C}{(1 + r)^t}$$

        Foundation of all DCF and NPV calculations. Higher discount rates
        or longer time horizons reduce present value.

    References:
        Startup Valuation textbook, Chapter 2, Section 2.2.

    See Also:
        net_present_value : Sum of discounted cash flows.
        annuity_present_value : Perpetual or fixed-period payments.

    Example:
        >>> result = present_value(11000, 0.08, 1)
        >>> round(result.value, 2)
        10185.19
    """
    if rate < -1:
        raise ValueError("rate must be >= -1")

    pv = future_value / ((1 + rate) ** periods)

    return ValuationResult(
        value=pv,
        steps=[
            {
                "label": "Present Value",
                "value": pv,
                "formula": r"PV = FV \div (1+r)^n",
            },
        ],
        method="Present Value",
        inputs={"future_value": future_value, "rate": rate, "periods": periods},
        assumptions=["Discount rate is constant over the period"],
        chapter="2",
        formula_number="2.2",
    )

net_present_value(cash_flows, rate)

Calculate net present value of a series of cash flows.

Formula: NPV = Σ Cₜ / (1 + r)^t

Parameters:

Name Type Description Default
cash_flows list[float]

Cash flows at each period (C₀, C₁, ..., Cₜ).

required
rate float

Discount rate (r).

required

Returns:

Type Description
ValuationResult

ValuationResult with NPV.

Raises:

Type Description
ValueError

If rate < -1.

Notes

Net present value sums all discounted cash flows:

$$NPV = \sum_{t=0}^{n} \frac{CF_t}{(1 + r)^t}$$

The first element is typically negative (initial investment). NPV > 0 indicates value creation. Used in DCF valuation and capital budgeting.

References

Startup Valuation textbook, Chapter 2, Section 2.3.

See Also

present_value : Single cash flow discounting. dcf_valuation : Full DCF with terminal value.

Example

result = net_present_value([-100000, 30000, 40000, 50000], 0.10) round(result.value, 0) -2103.0

Source code in src/startup_valuation/tv.py
def net_present_value(
    cash_flows: list[float],
    rate: float,
) -> ValuationResult:
    """Calculate net present value of a series of cash flows.

    Formula: NPV = Σ Cₜ / (1 + r)^t

    Args:
        cash_flows: Cash flows at each period (C₀, C₁, ..., Cₜ).
        rate: Discount rate (r).

    Returns:
        ValuationResult with NPV.

    Raises:
        ValueError: If rate < -1.

    Notes:
        Net present value sums all discounted cash flows:

        $$NPV = \\sum_{t=0}^{n} \\frac{CF_t}{(1 + r)^t}$$

        The first element is typically negative (initial investment).
        NPV > 0 indicates value creation. Used in DCF valuation
        and capital budgeting.

    References:
        Startup Valuation textbook, Chapter 2, Section 2.3.

    See Also:
        present_value : Single cash flow discounting.
        dcf_valuation : Full DCF with terminal value.

    Example:
        >>> result = net_present_value([-100000, 30000, 40000, 50000], 0.10)
        >>> round(result.value, 0)
        -2103.0
    """
    if rate < -1:
        raise ValueError("rate must be >= -1")

    npv = sum(cf / ((1 + rate) ** t) for t, cf in enumerate(cash_flows))

    return ValuationResult(
        value=npv,
        steps=[
            {
                "label": "Net Present Value",
                "value": npv,
                "formula": r"NPV = \sum \frac{CF_t}{(1+r)^t}",
            },
        ],
        method="Net Present Value",
        inputs={"cash_flows": cash_flows, "rate": rate},
        assumptions=["Discount rate is constant across all periods"],
        chapter="2",
        formula_number="2.3",
    )

annuity_present_value(payment, rate, periods)

Calculate present value of an annuity.

Formula: PV = C × [(1 - (1 + r)^(-n)) / r]

Parameters:

Name Type Description Default
payment float

Periodic payment (C).

required
rate float

Discount rate per period (r).

required
periods int

Number of periods (n).

required

Returns:

Type Description
ValuationResult

ValuationResult with present value.

Notes

Present value of equal payments at end of each period:

$$PV = C \times \left[\frac{1 - (1 + r)^{-n}}{r}\right]$$

When r = 0, PV = C × n. Used for valuing fixed-payment streams like lease payments or subscription revenue.

References

Startup Valuation textbook, Chapter 2, Section 2.4.

See Also

present_value : Single cash flow. net_present_value : Variable flows.

Example

result = annuity_present_value(50000, 0.10, 4) round(result.value, 0) 158495.0

Source code in src/startup_valuation/tv.py
def annuity_present_value(
    payment: float,
    rate: float,
    periods: int,
) -> ValuationResult:
    """Calculate present value of an annuity.

    Formula: PV = C × [(1 - (1 + r)^(-n)) / r]

    Args:
        payment: Periodic payment (C).
        rate: Discount rate per period (r).
        periods: Number of periods (n).

    Returns:
        ValuationResult with present value.

    Notes:
        Present value of equal payments at end of each period:

        $$PV = C \\times \\left[\\frac{1 - (1 + r)^{-n}}{r}\\right]$$

        When r = 0, PV = C × n. Used for valuing fixed-payment
        streams like lease payments or subscription revenue.

    References:
        Startup Valuation textbook, Chapter 2, Section 2.4.

    See Also:
        present_value : Single cash flow. net_present_value : Variable flows.

    Example:
        >>> result = annuity_present_value(50000, 0.10, 4)
        >>> round(result.value, 0)
        158495.0
    """
    if rate == 0:
        pv = payment * periods
    else:
        pv = payment * (1 - (1 + rate) ** (-periods)) / rate

    return ValuationResult(
        value=pv,
        steps=[
            {
                "label": "Annuity Present Value",
                "value": pv,
                "formula": r"PV = PMT \times \frac{1-(1+r)^{-n}}{r}",
            },
        ],
        method="Annuity Present Value",
        inputs={"payment": payment, "rate": rate, "periods": periods},
        assumptions=["Payments are equal and occur at end of each period"],
        chapter="2",
        formula_number="2.4",
    )

dcf_valuation(cash_flows, rate, terminal_growth=0.0)

Discounted cash flow with an explicit forecast plus a Gordon terminal value.

Formula: DCF = Σ Cₜ/(1+r)^t + [C_n (1+g)/(r−g)] / (1+r)^n

Parameters:

Name Type Description Default
cash_flows list[float]

Forecast free cash flows for periods t=1..n, in currency units.

required
rate float

Discount rate (r), must exceed terminal_growth.

required
terminal_growth float

Perpetual growth rate (g) applied after the forecast window.

0.0

Returns:

Type Description
ValuationResult

ValuationResult with the DCF value (enterprise value).

Raises:

Type Description
ValueError

If cash_flows is empty, or rate <= terminal_growth.

Notes

The explicit forecast is discounted period by period and a Gordon growth terminal value captures all cash flows beyond the horizon:

$$DCF = \sum_{t=1}^{n} \frac{CF_t}{(1+r)^t} + \frac{CF_n (1+g)}{(r-g)(1+r)^n}$$

Set terminal_growth=0 for a flat perpetuity. Standard for discounting projected startup cash flows when a terminal value is material.

References

Startup Valuation textbook, Chapter 2, Section 2.3.

See Also

net_present_value : NPV without a terminal value. wacc : Build the discount rate (r) from cost of equity and debt.

Example

result = dcf_valuation([100000, 120000, 140000], 0.12, 0.03) round(result.value, 0) 1425028.0

Source code in src/startup_valuation/tv.py
def dcf_valuation(
    cash_flows: list[float],
    rate: float,
    terminal_growth: float = 0.0,
) -> ValuationResult:
    """Discounted cash flow with an explicit forecast plus a Gordon terminal value.

    Formula: DCF = Σ Cₜ/(1+r)^t + [C_n (1+g)/(r−g)] / (1+r)^n

    Args:
        cash_flows: Forecast free cash flows for periods t=1..n, in currency units.
        rate: Discount rate (r), must exceed terminal_growth.
        terminal_growth: Perpetual growth rate (g) applied after the forecast window.

    Returns:
        ValuationResult with the DCF value (enterprise value).

    Raises:
        ValueError: If cash_flows is empty, or rate <= terminal_growth.

    Notes:
        The explicit forecast is discounted period by period and a Gordon growth
        terminal value captures all cash flows beyond the horizon:

        $$DCF = \\sum_{t=1}^{n} \\frac{CF_t}{(1+r)^t}
        + \\frac{CF_n (1+g)}{(r-g)(1+r)^n}$$

        Set ``terminal_growth=0`` for a flat perpetuity. Standard for discounting
        projected startup cash flows when a terminal value is material.

    References:
        Startup Valuation textbook, Chapter 2, Section 2.3.

    See Also:
        net_present_value : NPV without a terminal value.
        wacc : Build the discount rate (r) from cost of equity and debt.

    Example:
        >>> result = dcf_valuation([100000, 120000, 140000], 0.12, 0.03)
        >>> round(result.value, 0)
        1425028.0
    """
    if not cash_flows:
        raise ValueError("cash_flows must contain at least one period")
    if rate <= terminal_growth:
        raise ValueError("rate must be greater than terminal_growth")

    pv_explicit = sum(cf / ((1 + rate) ** t) for t, cf in enumerate(cash_flows, start=1))
    terminal_value = cash_flows[-1] * (1 + terminal_growth) / (rate - terminal_growth)
    pv_terminal = terminal_value / ((1 + rate) ** len(cash_flows))
    value = pv_explicit + pv_terminal

    return ValuationResult(
        value=value,
        method="Discounted Cash Flow",
        inputs={"cash_flows": cash_flows, "rate": rate, "terminal_growth": terminal_growth},
        assumptions=[
            "Cash flows are forecast for periods 1..n and discounted at a constant rate",
            "Terminal value uses the Gordon growth model",
        ],
        chapter="2",
        formula_number="2.3",
        steps=[
            {"label": "PV of explicit cash flows", "value": pv_explicit, "formula": r"\sum C_t/(1+r)^t"},
            {"label": "Terminal value", "value": terminal_value, "formula": r"C_n(1+g)/(r-g)"},
            {"label": "PV of terminal value", "value": pv_terminal, "formula": r"TV/(1+r)^n"},
        ],
    )