Fixed Income Forward
- torchquantlib.core.asset_pricing.bond.fixed_income_forward.fixed_income_forward(face_value: Tensor, rate: Tensor, time_to_maturity: Tensor, forward_rate: Tensor) Tensor[source]
Calculate the forward price of a fixed income security.
This function computes the forward price of a fixed income security using the continuous compounding formula. It’s based on the principle that the forward price should reflect the difference between the current interest rate and the forward rate over the time to maturity.
- Parameters:
face_value (Tensor) – The face value (or notional amount) of the fixed income security.
rate (Tensor) – The current interest rate (as a decimal).
time_to_maturity (Tensor) – The time to maturity of the forward contract (in years).
forward_rate (Tensor) – The forward interest rate (as a decimal).
- Returns:
The calculated forward price of the fixed income security.
- Return type:
Tensor
- Formula:
Forward Price = Face Value * e^((Forward Rate - Current Rate) * Time to Maturity)
Note
This function assumes continuous compounding. For discrete compounding, a different formula would be required.
This module provides implementation for pricing fixed income forward contracts.
Fixed Income Forward
- torchquantlib.core.asset_pricing.bond.fixed_income_forward.fixed_income_forward(face_value: Tensor, rate: Tensor, time_to_maturity: Tensor, forward_rate: Tensor) Tensor[source]
Calculate the forward price of a fixed income security.
This function computes the forward price of a fixed income security using the continuous compounding formula. It’s based on the principle that the forward price should reflect the difference between the current interest rate and the forward rate over the time to maturity.
- Parameters:
face_value (Tensor) – The face value (or notional amount) of the fixed income security.
rate (Tensor) – The current interest rate (as a decimal).
time_to_maturity (Tensor) – The time to maturity of the forward contract (in years).
forward_rate (Tensor) – The forward interest rate (as a decimal).
- Returns:
The calculated forward price of the fixed income security.
- Return type:
Tensor
- Formula:
Forward Price = Face Value * e^((Forward Rate - Current Rate) * Time to Maturity)
Note
This function assumes continuous compounding. For discrete compounding, a different formula would be required.
Usage Example
import torch
from torchquantlib.core.asset_pricing.bond.fixed_income_forward import fixed_income_forward
face_value = torch.tensor(1000.0)
rate = torch.tensor(0.05)
time_to_maturity = torch.tensor(2.0)
forward_rate = torch.tensor(0.06)
forward_price = fixed_income_forward(face_value, rate, time_to_maturity, forward_rate)
print(f"Fixed Income Forward Price: {forward_price.item():.2f}")
Formula
The forward price of a fixed income security is calculated using the following formula:
- Where:
Face Value is the notional amount of the fixed income security
Forward Rate is the interest rate agreed upon for the forward contract
Current Rate is the current market interest rate
Time to Maturity is the time until the forward contract expires (in years)
Note that this formula assumes continuous compounding. For discrete compounding, a different formula would be required.