Getting Started - Framework
CCruncher is designed to work in batch mode, without graphical support.
The user creates a xml file with the description of the
portfolio. CCruncher takes this file and simulates the portfolio N times.
The simulated values are stored in a csv file.
Finally, a R script takes the simulated
values and calculates some statistics on them to generate the graphs and the risk
indicators, such as the Expected Loss, Standard deviation, Value at Risk and
Expected Shortfall.
Getting Started - Installation
Step 1. If you have selected a packaged distribution, unpack it.
tar -xvzf ccruncher-X.Y_ZZZ.tgz
cd ccruncher-X.Y
Step 2. CCruncher uses a library named gsl not included in CCruncher
distribution packages. Check that you have gsl installed (find file libgsl.so
, usually in folder /usr/lib). In case you don't have
it, install it from the gsl site (if you use a RPM
system, install the package named gsl). CCruncher source distribution requires that
you have gsl-devel installed (find file gsl_math.h, usually in folder
/usr/include/gsl). In case you don't have it, install it from
gsl site (if you use a RPM system, install
the package named gsl-devel).
Step 3. CCruncher uses a library named expat not included in CCruncher
distribution packages. Check that you have expat installed (find file libexpat.so
or libexpat.dll, usually in folder /usr/lib). In case you don't have
it, install it from expat site (if you use a RPM
system, install the package named expat). CCruncher source distribution requires that
you have expat-devel installed (find file expat.h, usually in folder
/usr/include). In case you don't have it, install it from
expat site (if you use a RPM system, install
the package named expat-devel).
Step 4. CCruncher uses a library named zlib not included in CCruncher
distribution packages. Check that you have zlib installed (find file libz.so
or zlib1.dll, usually in folder /usr/lib). In case you don't have
it, install it from zlib site (if you use a RPM
system, install the package named zlib). CCruncher source distribution require that
you have zlib-devel installed (find file zlib.h, usually in folder
/usr/include). In case you don't have it, install it from
zlib site (if you use a RPM system, install
the package named zlib-devel).
Step 5. CCruncher uses a statistical package named R to compute risk indicators. Install it from the R project site. If you plan to realize the statistical computations with your own tools (eg. Excel) you can skip this step. If you use a RPM system, install package R.
Step 6. If you have a source distribution, run the following commands from within the CCruncher directory:
./configure # prepare compilation
make # compile ccruncher
bin/src2bin.sh # install and clean
Getting Started - Usage
Step 1. Create a XML ccruncher input file. First, read the
Technical Document and the
Input File Format document. You can
use a file from directory samples as a template. Take into
consideration that xml input can be gzipped (gz extension) to reduce
the file size. Caution, gzip is a compression algorithm different
from zip.
Step 2. Run ccruncher
bin/ccruncher --help
bin/ccruncher -f --hash=100 --path=data/ samples/test03.xml
Step 3. Check the output files, which are the csv files. Each column has the simulated segment values. The first line is a header that contains the segments names.
ls -l data/*
more data/portfolio.csv
Step 4. Use your prefered data analysis tool to compute the risk indicators.
Ccruncher provides a basic R script
located in $CCRUNCHER/bin/ccreport.R that implements the risk
indicators described in documentation. To run it, open a R console and type:
source("bin/ccreport.R")
ccruncher.summary("data/portfolio.csv")
ccruncher.graphic("data/portfolio.csv")
quit(save='no')
Linux/UNIX version has an additional script to create a report:
bin/ccreport.sh data/portfolio.csv
firefox data/portfolio.html