/** * Creates an instance. * * @param absoluteTol the absolute tolerance * @param relativeTol the relative tolerance * @param maxSteps the maximum steps */ public BroydenVectorRootFinder(double absoluteTol, double relativeTol, int maxSteps) { this(absoluteTol, relativeTol, maxSteps, new LUDecompositionCommons()); }
public void solveRandomNoiseTest() { final MatrixAlgebra ma = new OGMatrixAlgebra(); final double[] y = new double[20]; for (int i = 0; i < 20; i++) { y[i] = Y.get(i) + SIGMA.get(i) * NORMAL.nextRandom(); } final DoubleArray start = DoubleArray.of(0.7, 1.4, 0.2, -0.3); final NonLinearLeastSquare ls = new NonLinearLeastSquare(); final LeastSquareResults res = ls.solve(X, DoubleArray.copyOf(y), SIGMA, PARAM_FUNCTION, PARAM_GRAD, start); final double chiSqDoF = res.getChiSq() / 16; assertTrue(chiSqDoF > 0.25); assertTrue(chiSqDoF < 3.0); final DoubleArray trueValues = DoubleArray.of(1, 1, 0, 0); final DoubleArray delta = (DoubleArray) ma.subtract(res.getFitParameters(), trueValues); final LUDecompositionCommons decmp = new LUDecompositionCommons(); final LUDecompositionResult decmpRes = decmp.apply(res.getCovariance()); final DoubleMatrix invCovariance = decmpRes.solve(DoubleMatrix.identity(4)); double z = ma.getInnerProduct(delta, ma.multiply(invCovariance, delta)); z = Math.sqrt(z); assertTrue(z < 3.0); }
LUDecompositionResult luRes = DECOMPOSITION.apply(jacT); DoubleArray vS = luRes.solve(vLambda); return vS;
/** * Creates an instance. * * @param absoluteTol the absolute tolerance * @param relativeTol the relative tolerance * @param maxSteps the maximum steps */ public ShermanMorrisonVectorRootFinder(double absoluteTol, double relativeTol, int maxSteps) { this(absoluteTol, relativeTol, maxSteps, new LUDecompositionCommons()); }
/** * Creates an instance. * * @param absoluteTol the absolute tolerance * @param relativeTol the relative tolerance * @param maxSteps the maximum steps */ public NewtonDefaultVectorRootFinder(double absoluteTol, double relativeTol, int maxSteps) { this(absoluteTol, relativeTol, maxSteps, new LUDecompositionCommons()); }