Libor.LiborProcess
Class CalibratorTest

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

public class CalibratorTest
extends junit.framework.TestCase

A jUnit test suite for the class Calibrator. Sets up a Libor process of dimension 15 and then computes caplet implied volatilities from both analytic prices and Monte Carlo prices and checks if they are equal to the known Libor volatilities. This is done for every caplet.


Constructor Summary
CalibratorTest(java.lang.String testName)
          Constructor.
 
Method Summary
static junit.framework.Test calibratorTestSuite()
          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 testCapletImpliedSigma()
          Test the caplet implied volatilities computed from analytic caplet prices.
 void testMonteCarloCapletImpliedSigma()
          Test the caplet implied volatilities computed from Monte Carlo caplet prices.
 
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

CalibratorTest

public CalibratorTest(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.


calibratorTestSuite

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


testCapletImpliedSigma

public void testCapletImpliedSigma()
                            throws NoSolutionException
Test the caplet implied volatilities computed from analytic caplet prices.

Throws:
NoSolutionException

testMonteCarloCapletImpliedSigma

public void testMonteCarloCapletImpliedSigma()
                                      throws NoSolutionException
Test the caplet implied volatilities computed from Monte Carlo caplet prices. Warning, this can fail due to imprecision in the Monte Carlo price stemming from insufficient sample size. Required accuracy set at +-5%.

Throws:
NoSolutionException

main

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