private static Vector solve(Matrix Ai, Matrix Vi) { return new QRDecomposition(Ai).solve(Vi).viewColumn(0); }
private static Vector solve(Matrix A, Matrix y) { return new QRDecomposition(A).solve(y).viewColumn(0); }
/** * Predict the power law growth in number of unique samples from the first few data points. * Also check that the fitted growth coefficient is about right. * * @param m * @param currentIndex Total data points seen so far. Unique values should be log(currentIndex)*expectedCoefficient + offset. * @param expectedCoefficient What slope do we expect. * @return The predicted value for log(currentIndex) */ private static double predictSize(Matrix m, int currentIndex, double expectedCoefficient) { int rows = m.rowSize(); Matrix a = m.viewPart(0, rows, 1, 2); Matrix b = m.viewPart(0, rows, 0, 1); Matrix ata = a.transpose().times(a); Matrix atb = a.transpose().times(b); QRDecomposition s = new QRDecomposition(ata); Matrix r = s.solve(atb).transpose(); assertEquals(expectedCoefficient, r.get(0, 0), 0.2); return r.times(new DenseVector(new double[]{Math.log(currentIndex), 1})).get(0); }
Matrix x1 = qr.solve(reshape(new double[]{ -0.0178247686747641, 0.68631714634098, -0.335464858468858, 1.50249941751569, -0.669901640772149, -0.977025038942455, -1.18857546169856, -1.24792900492054
Matrix x1 = qr.solve(b()); Matrix xRef = reshape(new double[]{ -0.182580239668147, -0.437233627652114, 0.138787653097464, 0.672934739896228, -0.131420217069083, 0, 0, 0
Vector solve(Matrix Ai, Matrix Vi) { return new QRDecomposition(Ai).solve(Vi).viewColumn(0); }
private static Vector solve(Matrix A, Matrix y) { return new QRDecomposition(A).solve(y).viewColumn(0); }
private static Vector solve(Matrix Ai, Matrix Vi) { return new QRDecomposition(Ai).solve(Vi).viewColumn(0); }
private static Vector solve(Matrix A, Matrix y) { return new QRDecomposition(A).solve(y).viewColumn(0); }
Matrix x1 = qr.solve(reshape(new double[]{ -0.0178247686747641, 0.68631714634098, -0.335464858468858, 1.50249941751569, -0.669901640772149, -0.977025038942455, -1.18857546169856, -1.24792900492054
Matrix x1 = qr.solve(b()); Matrix xRef = reshape(new double[]{ -0.182580239668147, -0.437233627652114, 0.138787653097464, 0.672934739896228, -0.131420217069083, 0, 0, 0