Source code for skfolio.descriptor._leverage._debt_to_assets
"""Debt-to-assets ratio descriptor."""
# Copyright (c) 2023-2026
# Author: Hugo Delatte <hugo.delatte@skfoliolabs.com>
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import numpy as np
from skfolio.containers import AssetPanel
from skfolio.descriptor._base import BaseDescriptor
from skfolio.typing import FloatArray
from skfolio.utils.stats import safe_divide
from skfolio.utils.validation import validate_asset_panel
[docs]
class DebtToAssets(BaseDescriptor, stateless=True):
r"""Debt-to-assets ratio descriptor.
Computes the ratio of total debt to total assets:
.. math::
\text{debt\_to\_assets}(t) =
\frac{\text{total\_debt}(t)}{\text{total\_assets}(t)}
Debt-to-assets is the most widely used leverage descriptor in equity risk models.
It measures the proportion of a firm's asset base financed by debt. Higher values
indicate greater reliance on debt financing and, all else equal, a smaller equity
cushion to absorb losses, increasing the firm's vulnerability to earnings shocks,
adverse financing conditions and credit deterioration [1]_.
The ratio is naturally bounded between 0 (no debt) and approximately 1 (assets fully
debt-financed), though it can exceed 1 when accumulated losses erode equity below
zero, making total liabilities exceed total assets.
NaNs are allowed as missing observations and propagate to the output. Non-missing
`total_debt` values must be finite. Non-missing `total_assets` values must be
finite and strictly positive.
Parameters
----------
None
Attributes
----------
n_assets_ : int
Number of assets seen during fitting.
asset_names_ : ndarray of shape (n_assets,)
Asset names seen during fitting.
References
----------
.. [1] "Debt/equity ratio and expected common stock returns: empirical evidence"
The Journal of Finance. Bhandari, L. C. (1988).
See Also
--------
BookLeverage : Leverage as a fraction of total book capital.
MarketLeverage : Leverage as a fraction of total market capital.
Examples
--------
>>> from skfolio.datasets import make_synthetic_characteristics
>>> from skfolio.descriptor import DebtToAssets
>>>
>>> X = make_synthetic_characteristics()
>>>
>>> descriptor = DebtToAssets()
>>> debt_to_assets = descriptor.fit_transform(X)
"""