Libor.LiborDerivatives
Class CapletTest

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

public class CapletTest
extends junit.framework.TestCase

A jUnit test suite for the class Caplet. No jUnit assertions used, instead results printed for inspection.

Allocates a Libor process of dimension 16 and then calculates the prices of all caplets (strike 0.05, Libor L_j(0)=0.04) from samples of 20,000 paths. Analytic and Monte Carlo prices with and without control variates are printed and compared.

Results indicate that the necessary forward transporting from very early dates adds much variability. Performance of the control variate is unconvincing despite high corrleation.


Constructor Summary
CapletTest(java.lang.String testName)
          Constructor.
 
Method Summary
static junit.framework.Test capletTestSuite()
          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 Swing GUI
protected  void setUp()
          Do nothing on setUp since the test fixture is static final.
protected  void tearDown()
          Do nothing on tearDown since none of the tests alters the basic data.
 void testCapletForwardPrice()
          Test the computation of caplet implied vols.
 
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

CapletTest

public CapletTest(java.lang.String testName)
Constructor.

Method Detail

setUp

protected void setUp()
Do nothing on setUp since the test fixture is static final.


tearDown

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


capletTestSuite

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


testCapletForwardPrice

public void testCapletForwardPrice()
Test the computation of caplet implied vols.


main

public static void main(java.lang.String[] args)
run the tests in a Swing GUI