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


4.3 Curve.help

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

Class for setting up Curve objects.

This class contains all attributes and methods related to the following Curve types:

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

Methods for Curve object obj:

Attributes of Curve objects:

For illustration see the following example: A discount curve c is specified. A shock curve s provides absolute shocks for stress and relative shocks for MC scenarios, which are linearly interpolated and subsequently applied to the discount curve c. In the end, stress and MC discount rates are interpolated for given nodes with method getRate, while all curve rates are extracted with getValue.


c = Curve();
c = c.set('id','Discount_Curve','type','Discount Curve', ...
'nodes',[365,3650,7300],'rates_base',[0.01,0.02,0.04], ...
'method_interpolation','linear','compounding_type','continuous', ...
'day_count_convention','act/365');
s = Curve();
s = s.set('id','IR Shock','type','Shock Curve','nodes',[365,7300], ...
'rates_base',[],'rates_stress',[0.01,0.01;0.02,0.02;-0.01,-0.01;-0.01,0.01], ...
'rates_mc',[1.1,1.1;0.9,0.9;1.2,0.8;0.8,1.2],'timestep_mc','250d', ...
'method_interpolation','linear','shocktype_stress','absolute', ...
'shocktype_mc','relative');
c = c.apply_rf_shock('stress',s);
c = c.apply_rf_shock('250d',s);
c_base = c.getRate('base',1825)
c_rate_stress = c.getRate('stress',1825)
c_rate_250d = c.getRate('250d',1825)
c_rates_250d = c.getValue('250d')

Dependencies of class:

Curve

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