org.akutan.correlations.test
Class SpecDecompTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.akutan.correlations.test.SpecDecompTest
All Implemented Interfaces:
junit.framework.Test

public class SpecDecompTest
extends junit.framework.TestCase

These are the test cases from the paper "The Most General Way to Create a Valid Correlation Matrix for Risk Management and Option Pricing Purposes" by Rebonato and Jaekel, 1999. http://www.quarchome.org/correlationmatrix.pdf

Since:
18 Dec 2008

Constructor Summary
SpecDecompTest()
           
 
Method Summary
 void assertEquals(cern.colt.matrix.DoubleMatrix2D soln, cern.colt.matrix.DoubleMatrix2D test, double epsilon)
          Helper method to do a cell by cell comparison vs epsilon
 void test12x12()
          The more complicated 12x12 test case.
 void testDecomposition()
          The simple 3x3 test case from the paper, note that we agree with all but one of the values.
 void testGood()
          Here we operate on a known good matrix, we want to make sure we don't change it.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SpecDecompTest

public SpecDecompTest()
Method Detail

assertEquals

public void assertEquals(cern.colt.matrix.DoubleMatrix2D soln,
                         cern.colt.matrix.DoubleMatrix2D test,
                         double epsilon)
                  throws junit.framework.AssertionFailedError
Helper method to do a cell by cell comparison vs epsilon

Parameters:
soln -
test -
epsilon -
Throws:
junit.framework.AssertionFailedError

testGood

public void testGood()
              throws java.lang.Exception
Here we operate on a known good matrix, we want to make sure we don't change it.

Throws:
java.lang.Exception

testDecomposition

public void testDecomposition()
                       throws java.lang.Exception
The simple 3x3 test case from the paper, note that we agree with all but one of the values. The one we're off by is 0.00003.

Throws:
java.lang.Exception

test12x12

public void test12x12()
               throws java.lang.Exception
The more complicated 12x12 test case. Note for this one we get a Bhat value from the paper and need to 'square' it to get to the solution matrix. We just look for the X(c-c) value to be reasonable to declare it successful.

Throws:
java.lang.Exception