qis.implied_leverage

qis.implied_leverage(levered_returns, unlevered_returns)[source]

Estimate the implicit leverage ratio between two return series via OLS.

Regresses levered returns on unlevered returns and extracts the slope, which under the constant-leverage model equals (1 + L). Useful for inferring the effective leverage of a vehicle when not explicitly disclosed.

Parameters:
  • levered_returns (Series | DataFrame) – Returns of the levered vehicle (Series or DataFrame).

  • unlevered_returns (Series) – Returns of the unlevered analogue (Series).

Returns:

Implied leverage ratio L = slope - 1. For Series input, returns a float; for DataFrame input, returns a Series indexed by column name.

Return type:

float | Series

Note

The estimate is contaminated by any non-leverage differences between the two vehicles (security selection, sector tilts, financing spread). Use with caution and only when both vehicles target the same underlying exposure.

Example

Estimate the known debt/equity ratio of a synthetic levered series.

>>> from qis.datasets import generate_synthetic_prices
>>> prices = generate_synthetic_prices(start='2024-01-02', end='2024-03-28')
>>> asset_returns = to_returns(prices['SEQ_US'], is_log_returns=False).dropna()
>>> levered = 2 * asset_returns - 0.06 / 252
>>> L = implied_leverage(levered, asset_returns)
>>> print(f"Implied leverage: {L:.2f}x")
Implied leverage: 1.00x