Package org.jquantlib.math

Examples of org.jquantlib.math.SampledCurve


    // public constructors
    //

    public FDEuropeanEngine(final GeneralizedBlackScholesProcess process, final int timeSteps, final int gridPoints, final boolean timeDependent) {
        fdVanillaEngine = new FDVanillaEngine(process, timeSteps, gridPoints, timeDependent);
        prices = new SampledCurve(gridPoints);
        process.addObserver(this);
    }
View Full Code Here


        fdVanillaEngine.initializeOperator();
        fdVanillaEngine.initializeBoundaryConditions();

        final StandardFiniteDifferenceModel model = new StandardFiniteDifferenceModel(fdVanillaEngine.finiteDifferenceOperator, fdVanillaEngine.bcS);

        prices = new SampledCurve(fdVanillaEngine.intrinsicValues);
        prices.setValues( model.rollback(prices.values(), fdVanillaEngine.getResidualTime(), 0, fdVanillaEngine.timeSteps) );

        final OneAssetOption.ResultsImpl r = (OneAssetOption.ResultsImpl)results;
        r.value = prices.valueAtCenter();
        final Option.GreeksImpl greeks = r.greeks();
View Full Code Here

    public FDVanillaEngine(final GeneralizedBlackScholesProcess process, final int timeSteps, final int gridPoints, final boolean timeDependent) {
        this.process = process;
        this.timeSteps = timeSteps;
        this.gridPoints = gridPoints;
        this.timeDependent = timeDependent;
        this.intrinsicValues = new SampledCurve(gridPoints);
        bcS = new Vector<BoundaryCondition<TridiagonalOperator>>();
    }
View Full Code Here

    protected void setGridLimits(/* Real */final double center, /* Time */final double t) {
        QL.require(center > 0.0 , "negative or null underlying given"); // QA:[RG]::verified // TODO: message
        this.center = center;
        /* Size */final int newGridPoints = safeGridPoints(gridPoints, t);
        if (newGridPoints > intrinsicValues.size())
            intrinsicValues = new SampledCurve(newGridPoints);

        /* Real */final double volSqrtTime = Math.sqrt(process.blackVolatility().currentLink().blackVariance(t, center));

        // the prefactor fine tunes performance at small volatilities
        /* Real */final double prefactor = 1.0 + 0.02 / volSqrtTime;
View Full Code Here

    public FDStepConditionEngine(final GeneralizedBlackScholesProcess process,
            final int timeSteps, final int gridPoints, final boolean timeDependent) {
        super(process, timeSteps, gridPoints, timeDependent);
        this.controlBCs = new ArrayList<BoundaryCondition<TridiagonalOperator>>();
        this.controlPrices = new SampledCurve(gridPoints);
    }
View Full Code Here

        final List<TridiagonalOperator> operatorSet = new ArrayList<TridiagonalOperator>();
        List<Array> arraySet = new ArrayList<Array>();
        final BoundaryConditionSet<BoundaryCondition<TridiagonalOperator>> bcSet = new BoundaryConditionSet<BoundaryCondition<TridiagonalOperator>>();
        final StepConditionSet<Array> conditionSet = new StepConditionSet<Array>();

        prices =  new SampledCurve(intrinsicValues);
        controlPrices = new SampledCurve(intrinsicValues);
        controlOperator =  new TridiagonalOperator(finiteDifferenceOperator);
        controlBCs.add(bcS.get(0));
        controlBCs.add(bcS.get(1));

        operatorSet.add(finiteDifferenceOperator);
View Full Code Here

    public FDVanillaEngine(final GeneralizedBlackScholesProcess process, final int timeSteps, final int gridPoints, final boolean timeDependent) {
        this.process = process;
        this.timeSteps = timeSteps;
        this.gridPoints = gridPoints;
        this.timeDependent = timeDependent;
        this.intrinsicValues = new SampledCurve(gridPoints);
        bcS = new Vector<BoundaryCondition<TridiagonalOperator>>();
    }
View Full Code Here

    protected void setGridLimits(/* Real */final double center, /* Time */final double t) {
        QL.require(center > 0.0 , "negative or null underlying given"); // TODO: message
        this.center = center;
        /* Size */final int newGridPoints = safeGridPoints(gridPoints, t);
        if (newGridPoints > intrinsicValues.size())
            intrinsicValues = new SampledCurve(newGridPoints);

        /* Real */final double volSqrtTime = Math.sqrt(process.blackVolatility().currentLink().blackVariance(t, center));

        // the prefactor fine tunes performance at small volatilities
        /* Real */final double prefactor = 1.0 + 0.02 / volSqrtTime;
View Full Code Here

    public FDStepConditionEngine(final GeneralizedBlackScholesProcess process,
            final int timeSteps, final int gridPoints, final boolean timeDependent) {
        super(process, timeSteps, gridPoints, timeDependent);
        this.controlBCs = new ArrayList<BoundaryCondition<TridiagonalOperator>>();
        this.controlPrices = new SampledCurve(gridPoints);
    }
View Full Code Here

        final List<TridiagonalOperator> operatorSet = new ArrayList<TridiagonalOperator>();
        List<Array> arraySet = new ArrayList<Array>();
        final BoundaryConditionSet<BoundaryCondition<TridiagonalOperator>> bcSet = new BoundaryConditionSet<BoundaryCondition<TridiagonalOperator>>();
        final StepConditionSet<Array> conditionSet = new StepConditionSet<Array>();

        prices =  new SampledCurve(intrinsicValues);
        controlPrices = new SampledCurve(intrinsicValues);
        controlOperator =  new TridiagonalOperator(finiteDifferenceOperator);
        controlBCs.add(bcS.get(0));
        controlBCs.add(bcS.get(1));

        operatorSet.add(finiteDifferenceOperator);
View Full Code Here

TOP

Related Classes of org.jquantlib.math.SampledCurve

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.