Libor.LiborProcess
Class LiborProcessTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byLibor.LiborProcess.LiborProcessTest
All Implemented Interfaces:
junit.framework.Test

public class LiborProcessTest
extends junit.framework.TestCase

Class of unit tests for the class LiborProcess in the jUnit testing framework.


Constructor Summary
LiborProcessTest(java.lang.String testName)
          Constructor
 
Method Summary
 void assertEquals(double[][] A, double[][] B, double precision, java.lang.String message)
          Entry by entry equality of two dimensional (ragged) arrays.
 void assertEquals(double[] u, double[] v, double precision, java.lang.String message)
          Entry by entry equality of one dimensional arrays.
static junit.framework.Test liborProcessTestSuite()
          Returns the test suite object which is then run in one of the test suite runners juint.textui.TestRunner or junit.swingui.TestRunner.
static void main(java.lang.String[] args)
          Run the tests in a text UI.
protected  void setUp()
          Do nothing on setUp (test fixture is static final since none of the tests alters the basic data).
protected  void tearDown()
          Do nothing on tearDown since none of the tests alters the basic data.
 void testSwapRates()
          Tests the swap rates and annuities by comparing the streamlined implementations against the straightforward ones over a sample of ten paths.
 void testX0LiborMeans()
          Tests the mean of the Libor vector X0LiborVector(p) (X^0_p(T_p),X^0_{p+1}(T_p),....,X^0_{n-1}(T_p)) (both simulated directly and path simulated) against the known analytic mean vector.
 void testY0Covariances()
          Tests the covariation matrix of the vector of Y^0_j(T_p), j=p,...,q-1 (both simulated directly and path simulated) against the known analytic covariation matrix.
 void testZeroCouponBonds()
          Tests if the general zero coupon bond B(t,T) agrees with the special bonds B(i,j)=B(T_i,T_j) in case t=T_i, T=T_j.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, name, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LiborProcessTest

public LiborProcessTest(java.lang.String testName)
Constructor

Method Detail

setUp

protected void setUp()
Do nothing on setUp (test fixture is static final since none of the tests alters the basic data).


tearDown

protected void tearDown()
Do nothing on tearDown since none of the tests alters the basic data.


assertEquals

public void assertEquals(double[] u,
                         double[] v,
                         double precision,
                         java.lang.String message)
Entry by entry equality of one dimensional arrays.

Parameters:
u - first array.
v - second array (compared to first).
precision - maxiumum tolerated entry by entry deviation.
message - string attached to failure message.

assertEquals

public void assertEquals(double[][] A,
                         double[][] B,
                         double precision,
                         java.lang.String message)
Entry by entry equality of two dimensional (ragged) arrays.

Parameters:
A - first array.
B - second array (compared to first).
precision - maxiumum tolerated entry by entry deviation.
message - string attached to failure message.

liborProcessTestSuite

public static junit.framework.Test liborProcessTestSuite()
Returns the test suite object which is then run in one of the test suite runners juint.textui.TestRunner or junit.swingui.TestRunner.


testX0LiborMeans

public void testX0LiborMeans()
Tests the mean of the Libor vector X0LiborVector(p) (X^0_p(T_p),X^0_{p+1}(T_p),....,X^0_{n-1}(T_p)) (both simulated directly and path simulated) against the known analytic mean vector.


testY0Covariances

public void testY0Covariances()
Tests the covariation matrix of the vector of Y^0_j(T_p), j=p,...,q-1 (both simulated directly and path simulated) against the known analytic covariation matrix.


testZeroCouponBonds

public void testZeroCouponBonds()
Tests if the general zero coupon bond B(t,T) agrees with the special bonds B(i,j)=B(T_i,T_j) in case t=T_i, T=T_j. Test for various i,j along one path of Libor.


testSwapRates

public void testSwapRates()
Tests the swap rates and annuities by comparing the streamlined implementations against the straightforward ones over a sample of ten paths.


main

public static void main(java.lang.String[] args)
Run the tests in a text UI.