Skip to content

Assumptions

collegeplan.assumptions

Utility functions for normalizing return and inflation assumptions.

resolve_nominal_return(assumptions)

Return the nominal expected return, deriving from real if needed.

Source code in src/collegeplan/assumptions.py
def resolve_nominal_return(assumptions: Assumptions) -> float:
    """Return the nominal expected return, deriving from real if needed."""
    if assumptions.expected_return_nominal is not None:
        return assumptions.expected_return_nominal
    # Fisher equation: (1 + r_nom) = (1 + r_real)(1 + pi)
    r_real = assumptions.expected_return_real
    assert r_real is not None
    return (1 + r_real) * (1 + assumptions.general_inflation) - 1

resolve_real_return(assumptions)

Return the real expected return, deriving from nominal if needed.

Source code in src/collegeplan/assumptions.py
def resolve_real_return(assumptions: Assumptions) -> float:
    """Return the real expected return, deriving from nominal if needed."""
    if assumptions.expected_return_real is not None:
        return assumptions.expected_return_real
    r_nom = assumptions.expected_return_nominal
    assert r_nom is not None
    return (1 + r_nom) / (1 + assumptions.general_inflation) - 1

normalize_assumptions(assumptions)

Return a copy with both nominal and real returns populated.

Source code in src/collegeplan/assumptions.py
def normalize_assumptions(assumptions: Assumptions) -> Assumptions:
    """Return a copy with both nominal and real returns populated."""
    return replace(
        assumptions,
        expected_return_nominal=resolve_nominal_return(assumptions),
        expected_return_real=resolve_real_return(assumptions),
    )

deflate(nominal_value, years, inflation)

Convert a future nominal dollar amount to today's real dollars.

Source code in src/collegeplan/assumptions.py
def deflate(nominal_value: float, years: int, inflation: float) -> float:
    """Convert a future nominal dollar amount to today's real dollars."""
    return nominal_value / (1 + inflation) ** years