Next: , Previous: , Up: Octave octarisk Classes   [Contents][Index]


4.15 CapFloor.help

Octarisk Class: object = CapFloor(id)
Octarisk Class: object = CapFloor()

Class for setting up CapFloor objects. Plain vanilla caps and floors (consisting of caplet and floorlets) can be based on interest rates or inflation rates. Cash flows are generated according to different models (Black, Normal, Analytic) and subsequently discounted to calculate the CapFloor value.

In the following, all methods and attributes are explained and a code example is given.

Methods for CapFloor object obj:

Attributes of CapFloor objects:

For illustration see the following example: A 2 year Cap starting in 3 years is priced with Black model. The resulting Cap value (137.0063959386) and volatility spread (-0.0256826614604929)is retrieved:


disp('Pricing Cap Object with Black Model')
cap = CapFloor();
cap = cap.set('id','TEST_CAP','name','TEST_CAP','issue_date','30-Dec-2018', ...
'maturity_date','29-Dec-2020','compounding_type','simple');
cap = cap.set('term',365,'term_unit','days','notional',10000, ...
'coupon_generation_method','forward','notional_at_start',0, ...
'notional_at_end',0);
cap = cap.set('strike',0.005,'model','Black','last_reset_rate',0.0, ...
'day_count_convention','act/365','sub_type','CAP');
c = Curve();
c = c.set('id','IR_EUR','nodes',[30,1095,1460],'rates_base',[0.01,0.01,0.01], ...
'method_interpolation','linear');
v = Surface();
v = v.set('axis_x',365,'axis_x_name','TENOR','axis_y',90, ...
'axis_y_name','TERM','axis_z',1.0,'axis_z_name','MONEYNESS');
v = v.set('values_base',0.8);
v = v.set('type','IRVol');
cap = cap.rollout('31-Dec-2015','base',c,v);
cap = cap.calc_value('31-Dec-2015','base',c);
base_value = cap.getValue('base')
cap = cap.set('value_base',135.000);
cap = cap.calc_vola_spread('31-Dec-2015',c,v);
cap = cap.rollout('31-Dec-2015','base',c,v);
cap = cap.calc_value('31-Dec-2015','base',c);
vola_spread = cap.vola_spread

Dependencies of class:

CapFloor

Next: , Previous: , Up: Octave octarisk Classes   [Contents][Index]