Next: , Previous: , Up: Developer guide   [Contents][Index]


3.3 Input files

In the following, all required input files are introduced. The basic file format for instruments, positions, stresstests, risk factors and market data objects is comma separated with a variable number of header attributes. Each of these input files is further split into different sub types. Each sub type has his own header, which is directly followed by all entries belonging to this sub type. Each Header line is introduced by the string Header and without any space followed by the SUBTYPE in capital letters (e.g. HeaderFRB for fixed rate bonds of the instrument class). Each header attribute contains the name of the header and the type of the data: NameTYPE. There exist exactly four different attribut types:

Empty attribute values (e.g. ValueA,,1234) are ignored during parsing of the input files.

3.3.1 Risk factors

The risk factors input file contains all risk factors which are modeled by stochastic processes. The shocks of these risk factors are then used as input to the calculation of the scenario dependent index, curve, volatility and instrument values which have these risk factors as attached risk drivers.
The columns of the risk factors file consist of the following entries:

An example of the input file is given:

HeaderRISKFACTOR,nameCHAR,idCHAR,typeCHAR,descriptionCHAR,modelCHAR,meanNMBR, ...
   ... stdNMBR,skewNMBR,kurtNMBR,value_baseNMBR,mr_levelNMBR,mr_rateNMBR,nodeNMBR,node2NMBR,node3NMBR
Item,RF_EQ_DE,RF_EQ_DE,RF_EQ,Equity Germany,GBM,0,0.18,-0.5,5,9820,,,
Item,RF_EQ_EUR,RF_EQ_EUR,RF_EQ,Equity Euro,GBM,0,0.18,-0.5,5,,,,
Item,RF_FX_EURUSD,RF_FX_EURUSD,RF_FX,FX EUR USD,SRD,0,0.08,0,3,1.09,1.2,0.001,
Item,RF_VOLA_EQ_DE,RF_VOLA_EQ_DE,RF_VOLA,Impl Vol Ger,SRD,0,0.1,0,3,0.31,0.21,0.02,
Item,RF_IR_EUR_1Y,RF_IR_EUR_1Y,RF_IR,IR EUR 1year,BM,0,0.0011,0,3,0.0008,,,365
Item,RF_IR_EUR_10Y,RF_IR_EUR_10Y,RF_IR,IR EUR 10year,BM,0,0.0032,0,3,0.0026,,,3650
Item,RF_IR_EUR_20Y,RF_IR_EUR_20Y,RF_IR,IR EUR 20year,BM,0,0.006,0,3,0.015,,,7300
Item,RF_VOLA_COM_GOLD,RF_VOLA_COM_GOLD,RF_VOLA,VolGold,SRD,0,0.1,0,3,0.15,0.16,0.03,
Item,RF_SPPR_EUR_HY_5Y,RF_SPR_EUR_HY_5Y,RF_SPR,HY,BM,0,0.083,0.24,10,0.05,,,1825

3.3.2 Positions

The positions input file contains all portfolios and positions. Positions must point to instruments which are defined in the instruments input file. Both portfolios and positions are stored to structures. Thus, additional columns can be appended, which could then be used as positional attributes.
The columns of the portfolio contain the following characteristics :

Example definitions for some positions (positive quantity: long position, negative quantity: short position) in two portfolios:

HeaderPORTFOLIO,idCHAR,nameCHAR,descriptionCHAR
Item,FUND_AAA,Global Diversified,Global diversified test portfolio
Item,FUND_BBB,Global Derivatives,Global derivatives test portfolio
HeaderPOSITION,port_idCHAR,idCHAR,quantityNMBR
Item,FUND_AAA,A0RFFT,65
Item,FUND_AAA,A1JB4Q,179
Item,FUND_AAA,A1J7CK,135
Item,FUND_AAA,A1YC04,20
Item,FUND_AAA,BTCOIN,1.98
Item,FUND_AAA,ODAXC20160318,-0.01
Item,FUND_AAA,EQFORW01,1
Item,FUND_AAA,SYNTH01,0.1
Item,FUND_AAA,CASH_EUR,1000
Item,FUND_BBB,A0LGQL,723
Item,FUND_BBB,ODAXC20160318,-0.1
Item,FUND_BBB,EQFORW01,1
Item,FUND_BBB,SYNTH01,1
Item,FUND_BBB,CASH_EUR,1000

3.3.3 Instruments

The instruments input file contains the specifications of all instruments which are priced during instrument valuation. The instrument universe is split into different product types. Each of the product type has his own file header, reflecting the huge differences in instrument specification.
The basic header attributes, which all instruments have in common, are given. For detailed information of additional columns see the class diagram.

Example definitions for cash instruments:

HeaderCASH,nameCHAR,idCHAR,value_baseNMBR,typeCHAR,descriptionCHAR,currencyCHAR,asset_classCHAR
Item,Cash Account EUR,CASH_EUR,1,CASH,EUR Cash Account,EUR,cash

3.3.4 Stress tests

The stress test input file contains the definition of all stress test. Each stress test describes the behavior of one or more risk factor in a particular scenario. The risk factor shock values are directly applied to all risk factor IDs which have to be fully given (no regular expressions allowed).
The columns of the stress test file consists of following entries:

An example for possible stress test definitions are given:

#Stresstests Specifications
HeaderSTRESSTESTS,idCHAR,nameCHAR,objectCHAR,objecttypeCHAR,shocktypeCHAR, ...
  ... termCHAR,axis_xCHAR,axis_yCHAR,axis_zCHAR,method_interpolationCHAR,shockvalueCHAR
Item,STRESS01,IR-100bp,IR_EUR,curve,absolute,365,,,,linear,-0.01
Item,STRESS01,IR-100bp,IR_USD,curve,absolute,365,,,,linear,-0.01
Item,STRESS02,IR+100bp,IR_EUR,curve,absolute,365,,,,linear,+0.01
Item,STRESS02,IR+100bp,IR_USD,curve,absolute,365,,,,linear,+0.01
Item,STRESS03,SPREAD-100bp,SPREAD_EUR_FIN_A,curve,absolute,365,,,,linear,-0.01
Item,STRESS04,SPREAD+100bp,SPREAD_EUR_FIN_A,curve,absolute,365,,,,linear,+0.01
Item,STRESS05,INFL-100bp,INFL_EXP_CURVE,curve,absolute,365,,,,linear,-0.01
Item,STRESS06,INFL+100bp,INFL_EXP_CURVE,curve,absolute,365,,,,linear,+0.01
Item,STRESS07,EQ-30Pct,EQ_DE,index,relative,,,,,linear,0.7
Item,STRESS08,EQ+30Pc,EQ_DE,index,relative,,,,,linear,1.3
Item,STRESS09,ASIANFLU,VOLA_IR_EUR_0.0002,surface,value,,365|3650,365|3650,,,0.015|0.025;0.01|0.03
Item,STRESS10,IR_EURTwistPos,IR_EUR,curve,absolute,365|3650|7300,,,,linear,-0.01|0.01|0.03

New stress tests can be easily appended to the specification file.

3.3.5 Volatility surface

For all options and swaptions, the implied volatility is necessary to calculate the derivative theoretical value. In order to feed the implied volatility into the system, a term / moneyness surface has to be specified for index instruments and a underlying tenor / term / moneyness for IR instruments in a separate file. For all underlying index risk factors the impl. volatility data file has to be named like vol_index_RF_XX_YY.dat and vol_ir_RF_XX_YY.dat for all interest rate risk factor. The risk factor ID will be used to automatically identify the appropriate file. The structure of the file is a linearized version of the volatility surface (for term / moneyness instruments):

% term moneyness implied_vola
30 1.2 0.4
30 1.0 0.35
30 0.8 0.3
90 1.2 0.5
90 1.0 0.45
90 0.8 0.4

and the volatility cube for tenor term moneyness for interest rate instruments:

#tenor term moneyness implied_vola
365.00000 365.00000 1.00000 0.50000
365.00000 730.00000 1.00000 0.40000
365.00000 1095.00000 1.00000 0.30000
730.00000 730.00000 1.00000 0.35000
730.00000 365.00000 1.00000 0.30000
730.00000 1095.00000 1.00000 0.35000
365.00000 365.00000 1.25 0.50000
365.00000 730.00000 1.25 0.50000
365.00000 1095.00000 1.25 0.30000
730.00000 730.00000 1.25 0.35000
730.00000 365.00000 1.25 0.30000
730.00000 1095.00000 1.25 0.35000

All tenor and term values are given in days from valuation date.

During the full valuation approach the moneyness is a function of the underlying risk factor spot price over rate and the constant strike price over rate. A linear interpolation for the moneyness and a nearest neighbour mapping for tenors terms and constant extrapolation will be performed to calculate the new scenario dependent implied volatililty. Since the at-the-money volatility is itself a risk factor (modeled as a factor), the interpolated volatility will be adjusted by this scenario dependent factor. This process combines the conservation of volatility surface or cubes shape with the single factor stochastic modeling of the at-the-money volatility. Furthermore, it is also possible to generate a file with just one constant volatility.

3.3.6 Marketdata objects file

Market data objects store all relevant objects for full valuation instrument pricing. These objects can be interest and spread curves, aggregated curves (sum of curves), market indizes, exchange rates, volatility surfaces and cubes as well as call and put schedules. The base values of these objects can then be shocked by scenario dependent values, which were calculated for the attached risk factors. The market data objects are specified in a separate file following the same conventions as the instruments input file:

Please note: If the curve increments of the aggregated curve has differenct settings for compounding type, frequency and day count convention, an automatic conversion will be performed.

HeaderCURVE,idCHAR,nameCHAR,typeCHAR,descriptionCHAR,method_interpolationCHAR,nodesCHAR,rates_baseCHAR,compounding_typeCHAR,compounding_freqCHAR,day_count_conventionCHAR,floorNMBR,capNMBR
Curve,IR_EUR,IR_EUR,Discount Curve,EUR-SWAP Curve,monotone-convex,365|1095|1825|3650|7300|10950|21900,-0.00519251|-0.00508595|-0.00367762|0.00185694|0.00776253|0.00999986|0.00123,,,,0.0001,0.1
Curve,IR_USD,IR_USD,Discount Curve,USD-SWAP Curve,monotone-convex,365|1095|1825|3650|7300|10950|21900,0.00119251|0.00208595|0.00367762|0.00385694|0.01276253|0.01399986|0.00163,,,,,
Curve,SPREAD_EUR_HY,SPREAD_EUR_HY,Spread Curve,SPREAD_EUR_High Yield Curve,linear,1825,0.02,discrete,daily,30/360E,,
HeaderAGGREGATEDCURVE,idCHAR,nameCHAR,typeCHAR,descriptionCHAR,method_interpolationCHAR,nodesCHAR,incrementsCHAR,compounding_typeCHAR,compounding_freqCHAR,day_count_conventionCHAR
Curve,AGGR_SPREAD_USD_BBB,AGGR_SPREAD_USD_BBB,Aggregated Curve,Aggregated Spread Curve USD BBB,linear,1825,SPREAD_USD_AAA|SPREAD_USD_AA|SPREAD_USD_A|SPREAD_USD_BBB,,,
Curve,AGGR_EUR_FIN_BBB,AGGR_EUR_FIN_BBB,Aggregated Curve,Aggregated Spread Curve EUR USD,monotone-convex,30|91|365|730|1095,IR_EUR|SPREAD_EUR_HY,simple,annual,act/365
HeaderINDEX,idCHAR,nameCHAR,typeCHAR,currencyCHAR,descriptionCHAR,value_baseNMBR
Index,EQ_DE,DAX30,Equity Index,EUR,DAX Equity Index German Blue Chips,9820
Index,COM_GOLD,Gold,Commodity Index,USD,Gold 1 Ounce USD,1073
Index,FX_EURUSD,EUR_USD,Exchange Rate,EUR,EUR USD Exchange rate,1.08
HeaderSURFACE,idCHAR,nameCHAR,typeCHAR,descriptionCHAR,moneyness_typeCHAR,method_interpolationCHAR,riskfactorsCHAR
Surface,VOLA_IR_EUR,VOLA_IR_EUR,IR,Test description,K-S,linear,RF_VOLA_IR_EUR_730_365|RF_VOLA_IR_EUR_1825_3650

These two market objects (indizes and curves) reflect market objects with either just one scenario dependent value (a scalar like for indizes) or a certain constant number of dependent values per scenario (like a curve). For these objects it is possible to specify an arbitrary number of risk factors in order to get the most granular scenario dependent behaviour. For convenience reasons and because of the increased memory consumption, indizes and curves are up to now the only possible market objects. For volatility surface or cubes it is only possible to specify risk factors with just one scenario dependent value (at-the-money volatility). The market object (the volatility cube) is then offsetted by a constant value in each scenario, thus preserving the base value volatility smile. It is therefore not possible to model a scenario dependent smile.

3.3.7 Correlation matrix

The correlation file contains the correlations between risk factor in a linearized format. Only the lower (or upper) triangular matrix including the diagonal values has to be set. The first line is a header describing the three columns, but there is no possibility to . The order of the risk factors in the correlation file can be arbitrary. Only the subset of all risk factors, which are contained in the correlation file, are used during MC scenario generation. The risk factors specified in the correlation file must be a subset of risk factors specified in the risk factors file. During parsing of the file validation checks are performed in order to make sure, that all correlation pairs have been set. Otherwise an exception will be raised. After parsing, the correlation file is stored in Octaves built-in matrix format. The correlation matrix undergoes then a Cholesky decomposition to generate correlated random variables with a copula approach. Based on these correlated randum numbers, the four distribution moments (mean, standard deviation, skewness, kurtosis), which are given in the risk factor input file, are used to generate the marginal distributions for each risk factor based on the Pearson type I-VII distribution system. If the correlation matrix is not positive semi-definite, all negative eigenvalues are set to slightly positive numbers in an iterative approach, thus leading to positive semi-definiteness. Be aware, that the correlation settings may change. Further statistics on the correlation settings and on the statistical parameters of the marginal risk factor distributions may be automatically calculated if the appropriate flag is set in the settings. In this case, a correlation heat map shows the deviations of the final correlation settings compared to the input correlation settings. The correlation file contaings the following columns:

An example is given:

RF1CHAR,RF2CHAR,CorrelationNMBR
RF_EQ_DE,RF_EQ_DE,1
RF_EQ_EUR,RF_EQ_DE,0.96479531
RF_EQ_EU,RF_EQ_DE,0.890684579999999
RF_EQ_NA,RF_EQ_DE,0.81541365
...

Next: , Previous: , Up: Developer guide   [Contents][Index]