Next: Stochastic.help, Previous: Surface.help, Up: Octave octarisk Classes [Contents][Index]
Class for setting up Swaption objects. Possible underlyings are fixed and floating swap legs. Therefore the following Swaption types are introduced:
In the following, all methods and attributes are explained and a code example is given.
Methods for Swaption object obj:
Attributes of Swaption objects:
For illustration see the following example: A normal payer swaption with maturity in 20 years with underlying swaps starting in 20 years for 10 years, a volatility surface and a discount curve are priced. The resulting Swaption value (642.6867193851) is retrieved:
disp('Pricing Payer Swaption with underlyings (Normal Model)') r = Curve(); r = r.set('id','EUR-SWAP-NOFLOOR','nodes', ... [7300,7665,8030,8395,8760,9125,9490,9855,10220,10585,10900], ... 'rates_base',[0.02,0.01,0.0075,0.005,0.0025,-0.001, ... -0.002,-0.003,-0.005,-0.0075,-0.01], ... 'method_interpolation','linear'); fix = Bond(); fix = fix.set('Name','SWAP_FIXED','coupon_rate',0.045, ... 'value_base',100,'coupon_generation_method','forward', ... 'sub_type','SWAP_FIXED'); fix = fix.set('maturity_date','24-Mar-2046','notional',100, ... 'compounding_type','simple','issue_date','26-Mar-2036', ... 'term',365,'notional_at_end',0); fix = fix.rollout('base','31-Mar-2016'); fix = fix.rollout('stress','31-Mar-2016'); fix = fix.calc_value('31-Mar-2016','base',r); fix = fix.calc_value('31-Mar-2016','stress',r); float = Bond(); float = float.set('Name','SWAP_FLOAT','coupon_rate',0.00,'value_base',100, ... 'coupon_generation_method','forward','last_reset_rate',-0.000, ... 'sub_type','SWAP_FLOATING','spread',0.00); float = float.set('maturity_date','24-Mar-2046','notional',100, ... 'compounding_type','simple','issue_date','26-Mar-2036', ... 'term',365,'notional_at_end',0); float = float.rollout('base',r,'31-Mar-2016'); float = float.rollout('stress',r,'31-Mar-2016'); float = float.calc_value('30-Sep-2016','base',r); float = float.calc_value('30-Sep-2016','stress',r); v = Surface(); v = v.set('axis_x',30,'axis_x_name','TENOR', ... 'axis_y',45,'axis_y_name','TERM','axis_z',1.0,'axis_z_name','MONEYNESS'); v = v.set('values_base',0.376563388); v = v.set('type','IRVol'); s = Swaption(); s = s.set('maturity_date','26-Mar-2036','effective_date','31-Mar-2016'); s = s.set('strike',0.045,'multiplier',1,'sub_type', 'SWAPT_PAY', ... 'model','normal','tenor',10); s = s.set('und_fixed_leg','SWAP_FIXED','und_floating_leg','SWAP_FLOAT', ... 'use_underlyings',true); s = s.calc_value('31-Mar-2016','base',r,v,fix,float); s.getValue('base')
Dependencies of class:
Next: Stochastic.help, Previous: Surface.help, Up: Octave octarisk Classes [Contents][Index]