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


4.11 Synthetic.help

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

Class for setting up Synthetic objects. A Synthetic instrument is a linear combination of underlying instruments. The following Synthetic types are introduced:

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

Methods for Synthetic object obj:

Attributes of Synthetic objects:

For illustration see the following example: A fund modelled as synthetic instrument with two underlying indizes (MSCI World and Euro Stoxx 50) is set up and the synthetic value (1909.090909) is calculated and retrieved:


fprintf('Pricing Synthetic Instrument');
s = Synthetic();
instrument_cell = cell;
instrument_cell(1) = 'EURO_STOXX_50';
instrument_cell(2) = 'MSCIWORLD';
s = s.set('id','TestSynthetic','instruments',instrument_cell);
s = s.set('weights',[1,1],'currency','EUR');
i1 = Index();
i1 = i1.set('id','EURO_STOXX_50','value_base',1000,'scenario_stress',2000);
i2 = Index();
i2 = i2.set('id','MSCIWORLD','value_base',1000);
i2 = i2.set('scenario_stress',2000,'currency','USD');
fx = Index();
fx = fx.set('id','FX_EURUSD','value_base',1.1,'scenario_stress',1.2);
instrument_struct = struct();
instrument_struct(1).id = i1.id;
instrument_struct(1).object = i1;
instrument_struct(2).id = i2.id;
instrument_struct(2).object = i2;
index_struct = struct();
index_struct(1).id = fx.id;
index_struct(1).object = fx;
valuation_date = datenum('31-Mar-2016');
s = s.calc_value(valuation_date,'base',instrument_struct,index_struct);
s.getValue('base')

Dependencies of class:

Synthetic

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