Reduced Form Model

This module implements a simple reduced-form model for credit risk calculation.

Functions

torchquantlib.core.risk.credit_risk.reduced_form_model.reduced_form_model(lambda_0: Tensor, default_intensity: Tensor, recovery_rate: Tensor, time: Tensor) Tensor[source]

Implement a reduced-form model for credit risk.

This function calculates the expected loss of a credit instrument using a simple reduced-form model. It assumes a constant hazard rate (default intensity) and a constant recovery rate.

Parameters:
  • lambda_0 (Tensor) – Initial default intensity (not used in this simple model)

  • default_intensity (Tensor) – Constant hazard rate or default intensity

  • recovery_rate (Tensor) – Expected recovery rate in case of default (between 0 and 1)

  • time (Tensor) – Time horizon for the calculation

Returns:

Expected loss over the given time horizon

Return type:

Tensor

Note

  • This is a simplified model. More complex models might incorporate time-varying default intensities or stochastic recovery rates.

  • The lambda_0 parameter is included for potential future extensions but is not used in the current implementation.

Detailed Description

The reduced_form_model function implements a basic reduced-form model for credit risk assessment. This model is used to calculate the expected loss of a credit instrument over a given time horizon.

Key features of this implementation:

  1. Assumes a constant hazard rate (default intensity)

  2. Uses a constant recovery rate

  3. Calculates survival probability based on the default intensity and time

  4. Computes expected loss as a function of recovery rate and survival probability

Mathematical Background

The model uses the following key equations:

  1. Survival Probability: \(P(survival) = e^{-\lambda t}\) Where \(\lambda\) is the default intensity and \(t\) is the time horizon.

  2. Expected Loss: \(E(Loss) = (1 - R) * (1 - P(survival))\) Where \(R\) is the recovery rate.

Usage Example

Here’s a basic example of how to use the reduced_form_model function:

import torch
from torchquantlib.core.risk.credit_risk.reduced_form_model import reduced_form_model

# Set up parameters
lambda_0 = torch.tensor(0.05)
default_intensity = torch.tensor(0.03)
recovery_rate = torch.tensor(0.4)
time = torch.tensor(5.0)

# Calculate expected loss
expected_loss = reduced_form_model(lambda_0, default_intensity, recovery_rate, time)
print(f"Expected Loss: {expected_loss.item():.4f}")

Note

The current implementation does not use the lambda_0 parameter. This parameter is included for potential future extensions of the model, such as implementing time-varying default intensities.