Learn R Programming

FinancialMath (version 0.1.1)

swap.rate: Interest Rate Swap

Description

Solves for the fixed interest rate given the variable interest rates (either as spot rates or zero coupon bond prices).

Usage

swap.rate(rates, type="spot_rate")

Arguments

rates
vector of variable rates
type
rates as either "spot_rate" or "zcb_price"

Value

Details

For spot rates: $1=\sum_{k=1}^n[\frac{R}{(1+rates_k)^k}]+\frac{1}{(1+rates_n)^n}$

For zero coupon bond prices: $1=\sum_{k=1}^n(R*rates_k)+rates_n$

Where $R=$ fixed swap rate.

See Also

swap.commodity

Examples

Run this code

swap.rate(rates=c(.93,.95,.98,.90), type = "zcb_price")

Run the code above in your browser using DataLab