Package org.jquantlib.math.matrixutilities

Examples of org.jquantlib.math.matrixutilities.Array


        private final Array logY_;
        private final Interpolation interpolation_;

        public LogInterpolationImpl(final Array vx, final Array vy, final Interpolation.Interpolator factory) {
            super(vx, vy);
            this.logY_ = new Array(vx.size());
            this.interpolation_ = factory.interpolate(vx, logY_);
        }
View Full Code Here


        this.cashflows_ = new IborLeg(schedule, index)
        .withPaymentDayCounter(dayCounter)
        .withNotionals(100.0)
        .withPaymentAdjustment(schedule.businessDayConvention())
        .withFixingDays(fixingDays)
        .withSpreads(new Array(spreads)).Leg();

        addRedemptionsToCashflows(new double[] { redemption });

        QL.ensure(redemptions_.size() == 1, "multiple redemptions created");
View Full Code Here

    public Array initialValues()  {
        final double[] tmp = new double[size()];
        for (int i=0; i<size(); ++i) {
            tmp[i] = processes_.get(i).x0();
        }
        return new Array( tmp );
    }
View Full Code Here

    public Array drift(final /* @Time */double t, final Array x) {
        final double[] tmp = new double[size()];
        for (int i=0; i<size(); i++) {
            tmp[i] = processes_.get(i).drift(t, x.get(i));
        }
        return new Array( tmp );
    }
View Full Code Here

        this.strikes = strikes.clone();
        this.lowerExtrapolation = lowerExtrapolation;
        this.upperExtrapolation = upperExtrapolation;


        this.times = new Array(dates.length+1); // TODO: verify if length is correct
        this.variances = new Matrix(strikes.size(), dates.length+1); // TODO: verify if length is correct
        this.strikes = new Array(strikes.size()+1); // TODO: verify if length is correct

        for(int i = 1; i < strikes.size()+1; i++) {
            this.strikes.set(i, strikes.get(i-1));
        }
View Full Code Here

    // Overrides StochasticProcess
    //

    @Override
    public Array initialValues() {
        return new Array( new double[] { s0v_, v0v_ } );
    }
View Full Code Here

                final double[] result = new double[2];
                result[0] = riskFreeRate_.currentLink().forwardRate(t, t, Compounding.Continuous).rate()
                - dividendYield_.currentLink().forwardRate(t, t, Compounding.Continuous).rate() - 0.5 * vol * vol;

                result[1] = kappav_ * (thetav_ - ((discretization_ == Discretization.PartialTruncation) ? x1 : vol * vol));
                return new Array(result);
    }
View Full Code Here

    @Override
    public Array apply(final Array x0, final Array dx) {
        final double[] tmp = new double[2];
        tmp[0] = x0.get(0) * Math.exp(dx.get(0));
        tmp[1] = x0.get(1) + dx.get(1);
        return new Array(tmp);
    }
View Full Code Here

                break;
            default:
                throw new LibraryException("unknown discretization schema"); // QA:[RG]::verified // TODO: message
        }

        return new Array( retVal );
    }
View Full Code Here

        if (System.getProperty("EXPERIMENTAL") == null)
            throw new UnsupportedOperationException("Work in progress");

        this.size_ = size;
        this.index_ = index;
        this.initialValues_ = new Array(size_);
        this.fixingDates_ = new ArrayList<Date>(size_);
        this.fixingTimes_ = new ArrayList<Double>(size_);
        this.accrualStartTimes_ = new ArrayList<Double>(size_);
        this.accrualEndTimes_ = new ArrayList<Double>(size_);
        this.accrualPeriod_ = new ArrayList<Double>(size_);
        this.m1 = new Array(size_);
        this.m2 = new Array(size_);

        final DayCounter dayCounter = index_.dayCounter();
        final List<CashFlow> flows = null /* cashFlows() */; // FIXME: translate cashFlows();

        QL.require(this.size_ == flows.size() , wrong_number_of_cashflows); // QA:[RG]::verified // TODO: message
View Full Code Here

TOP

Related Classes of org.jquantlib.math.matrixutilities.Array

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.