Output Files

CCruncher leaves the output files in the directory indicated by the '-o' argument in ccruncher-cmd, or the directory indicated by the 'Output' textbox in the ccruncher-gui. CCruncher output files are:

File Content Format Number
segmentation.csv Portfolio or sub-portfolios simulated losses. CSV 1 or more
indexes.csv Additional info about simulated values. CSV 0 or 1
ccruncher.out Execution trace. TXT 1 (gui),
0 (cmd)

CCruncher uses the CSV file format to save tabular data. This is a widely accepted data format supported by all data analysis tool (SPSS, R, Excel, Matlab, Mathematica, etc.). CCruncher CSV files satisfy the following considerations:

segmentation.csv


#=============================================================================
# file generated by ccruncher-2.4.1
# input file: samples/test05.xml
# exposure: 167.00, 166.00, 167.00, 167.00, 167.00, 166.00
#=============================================================================
"S1-A", "S1-B", "S1-C", "S2-A", "S2-B", "S2-C"
44.00, 46.00, 75.00, 32.00, 39.00, 69.00
9.00, 30.00, 41.00, 14.00, 36.00, 35.00
0.00, 0.00, 3.00, 1.00, 0.00, 3.00
11.00, 21.00, 57.00, 13.00, 28.00, 67.00
11.00, 14.00, 37.00, 5.00, 8.00, 16.00
5.00, 17.00, 32.00, 13.00, 25.00, 57.00
12.00, 19.00, 29.00, 6.00, 9.00, 24.00
13.00, 31.00, 39.00, 18.00, 55.00, 71.00
1.00, 3.00, 10.00, 2.00, 2.00, 7.00
21.00, 30.00, 65.00, 15.00, 37.00, 77.00
0.00, 5.00, 8.00, 5.00, 11.00, 29.00
...
24.00, 57.00, 76.00, 14.00, 23.00, 40.00
    

These files contain the simulated losses of the indicated segmentation disaggregated by its segments (aka. sub-portfolios). There are so many files of this type as segmentations defined in the input file. The segmentation name lead to the corresponding file name (e.g., portfolio.csv and sector-ratings.csv samples/test05.xml), and the segment names leads to the corresponding column names. Each row is a simulation performed by CCruncher, and each value is the loss of the corresponding segment.

When there is more than one segment, the sum of row losses can differ slightly from the corresponding whole portfolio loss (located in a different file) due to the rounding errors (numeric values are rounded to 2 decimal places).

indexes.csv


"thread", "lhs", "antithetic"
1, 1, 0
1, 1, 0
2, 1, 1
2, 1, 0
1, 1, 1
2, 1, 0
...
1, 21, 0
1, 21, 1
...
2, 51, 0
2, 51, 1
    

This file contains additional info about simulated values. Its creation is managed by the '-i' argument in ccruncher-cmd or ccruncher-gui programs. We recommend disabling this option and not generate this file unless you are checking the program or trying to apply some variance reduction technique.

Each row contains information about the corresponding simulation. The first column (thread) contains the thread index (starting at 1) that performed the simulation. The second column contains the Latin Hypercube Sampling batch (where each batch consists of lhs sample size simulations). Finally, the third column (antithetic) indicates (0=false, 1=true) if this simulation is an antithetic variate or not.

ccruncher.out


        ccruncher is Copyright (C) 2004-2014 Gerard Torrent and licensed        
         under the GNU General Public License, version 2. More info at          
                            http://www.ccruncher.net                            

general information ************************************************************
  ccruncher version                                                2.4.1 (R1212)
  start time (dd/MM/yyyy hh:mm:ss)                           07/03/2014 07:15:08

reading input file *************************************************************
  file name                                                 [samples/test05.xml]
  file size                                                            274.69 KB
  define (user defined)                                                 NU=12.54
  define (user defined)                                                 R12=0.21
  define (user defined)                                                  W1=0.29
  define (user defined)                                                  W2=0.48
  define (input file)                                             numsims=200000
  define (input file)                                            copula=t(12.54)
  define (input file)                                            antithetic=true
  define (input file)                                                   lhs=1000
  define (input file)                                                     seed=0
  file checksum (adler32)                                             1900187585
  elapsed time parsing data                                         00:00:00.028

initialization procedure *******************************************************
  setting parameters -----------------------------------------------------------
    initial date                                                      01/01/2013
    end date                                                          01/01/2014
    number of ratings                                                          4
    number of factors                                                          2
    copula type                                                         t(12.54)
    transition matrix period (months)                                         12
    transition matrix regularization error (1M)                                0
    default probability functions                                       computed
    default probability splines (linear, cubic, none)                       cccn
  setting obligors to simulate -------------------------------------------------
    number of obligors                                                      1000
    number of simulated obligors                                            1000
  setting assets to simulate ---------------------------------------------------
    number of assets                                                        1000
    number of simulated assets                                              1000
    number of simulated data items                                          1000
  initializing aggregators -----------------------------------------------------
    output data directory                                                 [data]
    segmentation            [/home/gerard/projects/ccruncher/data/portfolio.csv]
    segmentation        [/home/gerard/projects/ccruncher/data/sector-rating.csv]

Monte Carlo ********************************************************************
  configuration ----------------------------------------------------------------
    seed used to initialize randomizer                          1393049708265257
    maximum execution time (seconds)                                       86400
    maximum number of iterations                                          200000
    antithetic mode                                                         true
    latin hypercube sampling                                                1000
    block size                                                               128
    number of threads                                                          4
  running Monte Carlo [1000 simulations per hash] ------------------------------
    ............................................................................
    ............................................................................
    ................................................
    simulations realized                                                  200000
    elapsed time creating random numbers                            00:00:01.045
    elapsed time simulating losses                                  00:00:01.581
    elapsed time writing data to disk                               00:00:00.273
    total simulation time                                           00:00:02.930

general information ************************************************************
  end time (dd/MM/yyyy hh:mm:ss)                             22/02/2014 07:15:11
  total elapsed time                                                00:00:03.020
    

ccruncher-gui program saves the execution trace in the ccruncher.out file. This file, together with the input file, allows interpreting the output files contents. The command line program (ccruncher-cmd) doesn't save its trace because it is designed with the Unix philosophy in mind (Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.). If you want to preserve the trace, you can redirect the program output using the tee utility.