Package org.jquantlib.lang.exceptions

Examples of org.jquantlib.lang.exceptions.LibraryException


            final double[] high,
            final double[] low) {

        final int dsize = date.length;
        if (open.length != dsize || close.length != dsize || high.length != dsize || low.length != dsize)
            throw new LibraryException("array sizes mismatch"); // QA:[RG]::verified

        final Series<K, IntervalPrice> retval = new Series<K, IntervalPrice>();
        for (int i=0; i< dsize; i++) {
            retval.put(date[i], new IntervalPrice(open[i], close[i], high[i], low[i]));
        }
View Full Code Here


      if (type==Option.Type.Call) {
            return Math.max(price - strike, 0.0);
        } else if (type==Option.Type.Put) {
            return Math.max(strike - price, 0.0);
        } else {
            throw new LibraryException(UNKNOWN_OPTION_TYPE); // QA:[RG]::verified
        }
    }
View Full Code Here

            final Matrix adjustedMatrix = null;//highamImplementation(matrix, maxIterations, tolerance);
            jd = new SymmetricSchurDecomposition(adjustedMatrix);
            eigenValues = jd.eigenvalues();
            break;
        default:
            throw new LibraryException("unknown or invalid salvaging algorithm"); // QA:[RG]::verified // TODO: message
        }

        // factor reduction
        double enough = componentRetainedPercentage * eigenValues.accumulate();
        if (componentRetainedPercentage == 1.0) {
View Full Code Here

            // TODO: code review :: please verify against QL/C++ code
            //result = highamImplementation(matrix, maxIterations, tol);
            // result = new CholeskyDecomposition().CholeskyDecomposition(result, true);
            break;
        default:
            throw new LibraryException(unknown_salvaging_algorithm); // QA:[RG]::verified // TODO: message
        }
        return result;
    }
View Full Code Here

                    applyExerciseCondition();
                }
            }
            break;
        default:
            throw new LibraryException("invalid exercise type"); // QA:[RG]::verified // TODO: message
        }
        underlying.postAdjustValues();
    }
View Full Code Here

  }


  @Override
    public Array grid(final double t) {
    throw new LibraryException("not implemented"); // QA:[RG]::verified // TODO: message
  }
View Full Code Here

     *
     * @see Arguments
     * @see PricingEngine
     */
    protected void setupArguments(final PricingEngine.Arguments a) /* @ReadOnly */ {
        throw new LibraryException(SETUP_ARGUMENTS_NOT_IMPLEMENTED);
    }
View Full Code Here

        if (type == Position.Long)
            return price - strike;
        else if (type == Position.Short)
            return strike - price;
        else
            throw new LibraryException (" Unknown Forward Type ");
    }
View Full Code Here

        if (variance >= Math.E) {
            if (discount == 0.0 && dividendDiscount == 0.0) {
                mu      = - 0.5;
                lambda  = 0.5;
            } else if (discount == 0.0)
                throw new LibraryException("null discount not handled yet"); // QA:[RG]::verified // TODO: message
            else {
                mu = Math.log(dividendDiscount / discount) / variance - 0.5;
                lambda = Math.sqrt( mu * mu - 2.0 * Math.log(discount) / variance);
            }
            D1 = log_H_S / stdDev + lambda * stdDev;
 
View Full Code Here

        final T tree;
        try {
            final Constructor<T> c = clazz.getConstructor(StochasticProcess1D.class, double.class, int.class, double.class);
            tree = clazz.cast( c.newInstance(bs, maturity, timeSteps_, payoff.strike() ));
        } catch (final Exception e) {
            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_));
View Full Code Here

TOP

Related Classes of org.jquantlib.lang.exceptions.LibraryException

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.