Package org.jquantlib.pricingengines.hybrid

Examples of org.jquantlib.pricingengines.hybrid.DiscretizedConvertible


            throw new LibraryException(e); // QA:[RG]::verified
        }

        final /*@Real*/ double creditSpread = a.creditSpread.currentLink().value();
        final Lattice lattice = new TsiveriotisFernandesLattice<T>(tree, riskFreeRate, maturity, timeSteps_, creditSpread, v, q);
        final DiscretizedConvertible convertible = new DiscretizedConvertible((ConvertibleBondOption.Arguments)a, bs, new TimeGrid(maturity, timeSteps_));

        convertible.initialize(lattice, maturity);
        convertible.rollback(0.0);
        r.value = convertible.presentValue();
    }
View Full Code Here


        final double creditSpread = this.a.creditSpread.currentLink().value();

        final Lattice lattice = new TsiveriotisFernandesLattice<T>(tree,riskFreeRate,maturity,
                                                 timeSteps_,creditSpread,v,q);

        final DiscretizedConvertible convertible =
                new DiscretizedConvertible(this.a, bs,
                                                 new TimeGrid(maturity, timeSteps_));

        convertible.initialize(lattice, maturity);
        convertible.rollback(0.0);
        this.r.value = convertible.presentValue();
    }
View Full Code Here

    if (from <= to)
            throw new IllegalStateException("cannot roll the asset back to "
          + to + " (it is already at t = " + from + ")");

    final DiscretizedConvertible convertible = (DiscretizedConvertible) (asset);

    final int iFrom = t.index(from);
    final int iTo = t.index(to);

    for (int i = iFrom - 1; i >= iTo; --i) {

      final Array newValues = new Array(size(i));
      final Array newSpreadAdjustedRate = new Array(size(i));
      final Array newConversionProbability = new Array(size(i));

      stepback(i, convertible.values(), convertible
          .conversionProbability(), convertible.spreadAdjustedRate(),
              newValues, newConversionProbability, newSpreadAdjustedRate);

      convertible.setTime(t.get(i));
      convertible.setValues(newValues);
      convertible.setSpreadAdjustedRate(newSpreadAdjustedRate);
      convertible.setConversionProbability(newConversionProbability);

      // skip the very last adjustment
      if (i != iTo)
                convertible.adjustValues();
    }
  }
View Full Code Here

TOP

Related Classes of org.jquantlib.pricingengines.hybrid.DiscretizedConvertible

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.