|
From: Hari <hve...@gm...> - 2012-09-14 11:10:18
|
Hi, I am a new person into this QuantLib (both C++ and Java) world and trying to understand the various models published and particularly on piece wise yield curve (for ALM yield curve modelling). I am using the version 1.2. When I try to test a simple piece wise (Discount, LogLinear) model, I get the below stack trace. Exception in thread "main" java.lang.NullPointerException at org.jquantlib.termstructures.yieldcurves.InterpolatedZeroCurve.maxDate(Interpola tedZeroCurve.java:234) at org.jquantlib.termstructures.AbstractTermStructure.checkRange(AbstractTermStruct ure.java:286) at org.jquantlib.termstructures.AbstractYieldTermStructure.discount(AbstractYieldTe rmStructure.java:375) at org.jquantlib.termstructures.AbstractYieldTermStructure.discount(AbstractYieldTe rmStructure.java:367) at org.jquantlib.termstructures.yieldcurves.PiecewiseYieldCurve.discount(PiecewiseY ieldCurve.java:687) at org.jquantlib.indexes.IborIndex.forecastFixing(IborIndex.java:240) at org.jquantlib.indexes.InterestRateIndex.fixing(InterestRateIndex.java:175) at org.jquantlib.indexes.InterestRateIndex.fixing(InterestRateIndex.java:180) at org.jquantlib.testsuite.termstructures.yieldcurves.PiecewiseYieldCurveTest.testC urveConsistency(PiecewiseYieldCurveTest.java:407) at org.jquantlib.testsuite.termstructures.yieldcurves.PiecewiseYieldCurveTest.testC urveConsistency(PiecewiseYieldCurveTest.java:381) at org.jquantlib.testsuite.termstructures.yieldcurves.PiecewiseYieldCurveTest.testS plineZeroConsistency(PiecewiseYieldCurveTest.java:718) I used the sample test program provided in the 'testsuite'. I tried to debug and finally understand that 'Interpolation' curve is not initialized at all. Can anyone help to provide me a working sample of a piece wise yield curve in Java using JQuantLib (v1.2)? Thanks. |