Package Jama

Examples of Jama.QRDecomposition


     * inversion/qr decomposition until the preferable
     * Apache commons class catches up. Matrix is the Jama version
     * RealMatrixImpl is the commons version.
     */
    Matrix v = new Matrix(new VandermondeMatrix(x,order+1).getMatrix().getData());
    QRDecomposition qr = new QRDecomposition(v);
    rMatrix = new RealMatrixImpl(qr.getR().getArray());
    qMatrix = new RealMatrixImpl(qr.getQ().getArray());
    RealMatrix qMatrixTransposed = qMatrix.transpose();
    RealMatrix qByY = qMatrixTransposed.multiply(yMatrix);
    RealMatrix  rMatrixInverse = new RealMatrixImpl(new Matrix(rMatrix.getData()).inverse().getArray());
    RealMatrix resultMatrix = rMatrixInverse.multiply(qByY);
    coefficiants= resultMatrix.getColumn(0);
View Full Code Here


            errorCount = try_failure(errorCount, "times(double)...",
                    "incorrect Matrix-scalar product calculation");
        }

        A = new Matrix(columnwise, 4);
        QRDecomposition QR = A.qr();

        R = QR.getR();
        try {
            check(A, QR.getQ().times(R));
            try_success("QRDecomposition...", "");
        } catch (java.lang.RuntimeException e) {
            errorCount = try_failure(errorCount, "QRDecomposition...",
                    "incorrect QR decomposition calculation");
        }
View Full Code Here

            Matrix R = L.times(U).minus(M.getMatrix(p, 0, n - 1));
            double res = R.norm1() / (n * eps);

            print(fixedWidthDoubletoString(res, 12, 3));

            QRDecomposition QR = new QRDecomposition(M);
            Matrix Q = QR.getQ();

            R = QR.getR();
            R = Q.times(R).minus(M);
            res = R.norm1() / (n * eps);
            print(fixedWidthDoubletoString(res, 12, 3));

            print("\n");
View Full Code Here

            }
            yMatrix.set(row, 0, dataRow.getIdeal()[0]);
        }

        // Calculate the least squares solution
        final QRDecomposition qr = new QRDecomposition(xMatrix);
        final Matrix beta = qr.solve(yMatrix);

        double sum = 0.0;
        for (int i = 0; i < inputColCount; i++)
            sum += yMatrix.get(i, 0);
        final double mean = sum / inputColCount;
View Full Code Here

TOP

Related Classes of Jama.QRDecomposition

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.