Next: Implementation workflow, Previous: Developer guide, Up: Developer guide [Contents][Index]
A lightweight implementation concept was chosen for OCTARISK. One script is responsible for the complete work flow from input file parsing to aggregation and reporting. This script calls subfunctions to parse input data and construct objects, generate scenario dependent input values and call appropriate pricing functions. To assist developers, script are introduced for automatic generation of class diagrams (function print_class2dot) and function dependencies (get_dependencies). Moreover, all function and class descriptions, which are contained in the source files, are automatically extracted and appended to this document (see functions get_documentation and get_documentation_classes for details). A command line help for all functions (help functionname) and classes (Classname.help) is possible. To get performance insights, use the profiler (function profiler_analysis) to conveniently show detailled information.
The following process summarizes the complete work flow:
Input files (See Input files) are parsed into structures, matrizes and objects. After parsing of these input files, Monte-Carlo and stress test scenarios are generated taking into account the correlation matrix and marginal risk factor distributions as well as custom stress test scenario configurations. The scenario dependent shocks are then stored for each risk factor object. The scenario shocks are then applied to all market data objects (mainly indizes, curves and exchange rates) which have attached risk factors. Scenario dependent values for each market data object are calculated by taken into account the scenario dependent shock, the market data base value and the risk factor stochastic model. In a next step instrument pricing takes place. For each instrument object the product type dependent calculation rule is triggered. If the sensitivity approach is chosen, scenario shocks (delta values) are applied to the instrument base value. In case of a full valuation approach, the instrument is priced with specified pricing engines taking into account all scenario dependent market object values. A mark-to-market procedure is applied, which results in equal theoretical and market base values (by setting an appropriate spread over yield or volatility spread). After all instruments have been priced, the aggregation starts for all portfolios and their positions. Final results are printed in graphical and text based reports reflecting the market risk measures.
OCTARISK was set up in an object oriented programming style for all objects like instruments, risk factors, curves, indizes and surfaces. Inside the methods of the aforementioned classes, pricing or interpolation functions are called. The following class diagram gives an overview of all classes:
See the class documentation in the next chapter for further information.
Next: Implementation workflow, Previous: Developer guide, Up: Developer guide [Contents][Index]