Next: , Previous: , Up: Octave Functions and Scripts   [Contents][Index]


5.23 getCapFloorRate

Function File: [rate] = getCapFloorRate (CapFlag, F, X, tf, sigma, model)

Compute the forward rate of caplets or floorlets according to Black, Normal or analytical calculation formulas.

Input and output variables:

For Black model, the following formulas are applied:

Caplet_rate = (F*N( d1) - X*N( d2))
Floorlet_rate = (X*N(-d2) - F*N(-d1))
d1 = (log(F/X) + (0.5*sigma^2)*T)/(sigma*sqrt(tf))
d2 = d1 - sigma*sqrt(tf)

For Normal model, the following formulas are applied:

Caplet_rate = (F - X) * normcdf(d)  + sigma*sqrt(tf) * normpdf(d)
Floorlet_rate = (X - F) * normcdf(-d) + sigma*sqrt(tf) * normpdf(d)
d = (F - X) / (sigma*sqrt(tf));

For analytical model, the following formulas are applied:

Caplet_rate = max(0, F - X);
Floorlet_rate = max(0, X - F);

See also: swaption_bachelier, swaption_black76.