C# 클래스 HullAndWhiteOneFactor.SwaptionHW1

This class provides closed form pricing of for Swaptions (the holder has the right to pay the fixed rate and receive floating rate) using the HW1 factor model.
파일 보기 프로젝트 열기: fairmat/InterestRatesModels 1 사용 예제들

공개 메소드들

메소드 설명
A ( double t, double T, double alpha, double sigma, System.Function zeroRateCurve ) : double

Calculates the function A() to be used in the Bond() method.

ForwardSwapRate ( double t, Vector T ) : double

Calculates the forward swap rate.

Func ( Vector x ) : double

Function to be used in the FSolve() problem of HWSwaption() method. This is a version done to double check the HW Swaption, with dt fixed to 0.001.

HWSwaption ( double a, double sigma, double l, double k, double T, Vector s ) : double

Price of a swaption in HW1 model: the holder has the right to pay the fixed rate and receive floating rate. This is a different version of the main one to do a double check of the swaption.

HWSwaption ( double a, double sigma, double l, double k, double swaptionMaturity, double swapDuration, double deltaK ) : double
HWSwaptionMatrix ( Vector swaptionMaturity, Vector swapDuration, double a, double sigma, double deltaK ) : System.Matrix

Calculates a matrix of swaption prices within Hull-White model.

SwaptionHW1 ( System.Function zeroratecurve ) : System

Initializes a new instance of the HullAndWhiteOneFactor.SwaptionHW1 class.

ZCBPut ( double a, double sigma, double L, double K, double T, double s ) : double

Calculates the value of a put option on a zero coupon bond.

alphaTFunc ( double t ) : double

Calculation of alpha function

비공개 메소드들

메소드 설명
AlphaInt ( double t, double T, double alpha, double sigma, System.Function zeroRateCurve ) : double

Calculates the integral of alpha function to be used in the A() method.

B ( double T, double alpha ) : double

Calculates the function B() to be used in the Bond() method.

F ( double t, double dt ) : double

Numerically calculates the instantaneous forward rate.

H ( double a, double sigma, double L, double K, double T, double s ) : double

Calculates H() function to be used in ZCBPut() method.

HWBond ( double a, double sigma, double r, Vector T, double t ) : Vector

Calculates a vector of zero coupon bond prices (discount factors) within the Hull-White model. This is a version done to double check the HW swaption.

PZC ( double t ) : double

Helper function to make functions easier to read. Just returns the value of the discount factor at position t. This is calculated with e^(-ZR(t)*t).

SigmaP ( double a, double sigma, double T, double s ) : double

Calculates SigmaP() function to be used in ZCBPut() method.

ZR ( double k ) : double

Helper function to make functions easier to read. Just returns the value of the zero rate at position k.

메소드 상세

A() 공개 정적인 메소드

Calculates the function A() to be used in the Bond() method.
public static A ( double t, double T, double alpha, double sigma, System.Function zeroRateCurve ) : double
t double /// The time at which the Bond price will be calculated. ///
T double /// The bond maturity. ///
alpha double /// Hull-White alpha parameter. ///
sigma double /// Hull-White sigma parameter. ///
zeroRateCurve System.Function /// Zero rate curve. ///
리턴 double

ForwardSwapRate() 공개 메소드

Calculates the forward swap rate.
public ForwardSwapRate ( double t, Vector T ) : double
t double /// The swap starting time. ///
T Vector /// The vector of swap payment times. ///
리턴 double

Func() 공개 메소드

Function to be used in the FSolve() problem of HWSwaption() method. This is a version done to double check the HW Swaption, with dt fixed to 0.001.
public Func ( Vector x ) : double
x Vector /// Vector of length 1 representing the variable on which the FSolve problem is performed. ///
리턴 double

HWSwaption() 공개 메소드

Price of a swaption in HW1 model: the holder has the right to pay the fixed rate and receive floating rate. This is a different version of the main one to do a double check of the swaption.
public HWSwaption ( double a, double sigma, double l, double k, double T, Vector s ) : double
a double /// Hull-White alpha parameter. ///
sigma double /// Hull-White sigma parameter. ///
l double /// The Notional. ///
k double /// The Strike. ///
T double /// The maturity. ///
s Vector /// Vector of swaption payment dates. ///
리턴 double

HWSwaption() 공개 메소드

public HWSwaption ( double a, double sigma, double l, double k, double swaptionMaturity, double swapDuration, double deltaK ) : double
a double
sigma double
l double
k double
swaptionMaturity double
swapDuration double
deltaK double
리턴 double

HWSwaptionMatrix() 공개 메소드

Calculates a matrix of swaption prices within Hull-White model.
public HWSwaptionMatrix ( Vector swaptionMaturity, Vector swapDuration, double a, double sigma, double deltaK ) : System.Matrix
swaptionMaturity Vector /// Vector of swaption maturity. ///
swapDuration Vector /// Vector of swap duration. ///
a double /// Hull-White alpha parameter. ///
sigma double /// Hull-White sigma parameter. ///
deltaK double /// Time interval between swap coupon expressed in year fraction. ///
리턴 System.Matrix

SwaptionHW1() 공개 메소드

Initializes a new instance of the HullAndWhiteOneFactor.SwaptionHW1 class.
public SwaptionHW1 ( System.Function zeroratecurve ) : System
zeroratecurve System.Function /// The zero-rate curve reference for the model. ///
리턴 System

ZCBPut() 공개 메소드

Calculates the value of a put option on a zero coupon bond.
public ZCBPut ( double a, double sigma, double L, double K, double T, double s ) : double
a double /// Hull-White alpha parameter. ///
sigma double /// Hull-White sigma parameter. ///
L double /// Zero coupon notional. ///
K double /// Bond rate. ///
T double /// The maturity of the option. ///
s double /// The maturity of the bond. ///
리턴 double

alphaTFunc() 공개 메소드

Calculation of alpha function
public alphaTFunc ( double t ) : double
t double Time at which calculate the alpha function
리턴 double