• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java CholeskyDecomposition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.commons.math3.linear.CholeskyDecomposition的典型用法代码示例。如果您正苦于以下问题:Java CholeskyDecomposition类的具体用法?Java CholeskyDecomposition怎么用?Java CholeskyDecomposition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CholeskyDecomposition类属于org.apache.commons.math3.linear包,在下文中一共展示了CholeskyDecomposition类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: cholesky

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Calculates the Cholesky decomposition of a matrix. The Cholesky
 * decomposition of a real symmetric positive-definite matrix A consists of
 * a lower triangular matrix L with same size such that: A = LLT. In a
 * sense, this is the square root of A.
 *
 * @param a The given matrix.
 * @return Result array.
 */
public static Array cholesky(Array a) {
    Array r = Array.factory(DataType.DOUBLE, a.getShape());
    double[][] aa = (double[][]) ArrayUtil.copyToNDJavaArray(a);
    RealMatrix matrix = new Array2DRowRealMatrix(aa, false);
    CholeskyDecomposition decomposition = new CholeskyDecomposition(matrix);
    RealMatrix L = decomposition.getL();
    int n = L.getColumnDimension();
    int m = L.getRowDimension();
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < n; j++) {
            r.setDouble(i * n + j, L.getEntry(i, j));
        }
    }

    return r;
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:26,代码来源:LinalgUtil.java


示例2: estimateCoefficients

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
@Override
public SlopeCoefficients estimateCoefficients(final DerivationEquation eq)
    throws EstimationException {
  final double[][] sourceTriangleMatrix = eq.getCovarianceLowerTriangularMatrix();
  // Copy matrix and enhance it to a full matrix as expected by CholeskyDecomposition
  // FIXME: Avoid copy job to speed-up the solving process e.g. by extending the CholeskyDecomposition constructor
  final int length = sourceTriangleMatrix.length;
  final double[][] matrix = new double[length][];
  for (int i = 0; i < length; i++) {
    matrix[i] = new double[length];
    final double[] s = sourceTriangleMatrix[i];
    final double[] t = matrix[i];
    for (int j = 0; j <= i; j++) {
      t[j] = s[j];
    }
    for (int j = i + 1; j < length; j++) {
      t[j] = sourceTriangleMatrix[j][i];
    }
  }
  final RealMatrix coefficients =
      new Array2DRowRealMatrix(matrix, false);
  try {
    final DecompositionSolver solver = new CholeskyDecomposition(coefficients).getSolver();
    final RealVector constants = new ArrayRealVector(eq.getConstraints(), true);
    final RealVector solution = solver.solve(constants);
    return new DefaultSlopeCoefficients(solution.toArray());
  } catch (final NonPositiveDefiniteMatrixException e) {
    throw new EstimationException("Matrix inversion error due to data is linearly dependent", e);
  }
}
 
开发者ID:scaleborn,项目名称:elasticsearch-linear-regression,代码行数:31,代码来源:CommonsMathSolver.java


示例3: getWhiteningTransformation

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Returns the 'root' (U) of the inverse covariance matrix S^{-1},
 * such that S^{-1} = U^T . U
 * This matrix can be used to pre-transform the original sample
 * vectors X (by X &#8594; U . X) to a space where distance measurement (in the Mahalanobis
 * sense) can be calculated with the usual Euclidean norm.
 * The matrix U is invertible in case the reverse mapping is required.
 * 
 * @return The matrix for pre-transforming the original sample vectors.
 */
public double[][] getWhiteningTransformation() {
	IJ.log("in whitening");
	double relativeSymmetryThreshold = 1.0E-6; 		// CholeskyDecomposition.DEFAULT_RELATIVE_SYMMETRY_THRESHOLD == 1.0E-15; too small!
       double absolutePositivityThreshold = 1.0E-10;	// CholeskyDecomposition.DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD == 1.0E-10;
	CholeskyDecomposition cd = 
			new CholeskyDecomposition(MatrixUtils.createRealMatrix(iCov),
					relativeSymmetryThreshold, absolutePositivityThreshold);
	RealMatrix U = cd.getLT();
	return U.getData();
}
 
开发者ID:imagingbook,项目名称:imagingbook-common,代码行数:21,代码来源:MahalanobisDistance.java


示例4: solve

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
@Override
protected RealVector solve(final RealMatrix jacobian,
                           final RealVector residuals) {
    try {
        final Pair<RealMatrix, RealVector> normalEquation =
                computeNormalMatrix(jacobian, residuals);
        final RealMatrix normal = normalEquation.getFirst();
        final RealVector jTr = normalEquation.getSecond();
        return new CholeskyDecomposition(
                normal, SINGULARITY_THRESHOLD, SINGULARITY_THRESHOLD)
                .getSolver()
                .solve(jTr);
    } catch (NonPositiveDefiniteMatrixException e) {
        throw new ConvergenceException(LocalizedFormats.UNABLE_TO_SOLVE_SINGULAR_PROBLEM, e);
    }
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:17,代码来源:GaussNewtonOptimizer.java


示例5: correct

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Correct the current state estimate with an actual measurement.
 *
 * @param z the measurement vector
 * @throws DimensionMismatchException if the dimension of the
 * measurement vector does not fit
 * @throws org.apache.commons.math3.linear.SingularMatrixException
 * if the covariance matrix could not be inverted
 */
public void correct(final RealVector z) {
    // sanity checks
    MathUtils.checkNotNull(z);
    if (z.getDimension() != measurementMatrix.getRowDimension()) {
        throw new DimensionMismatchException(z.getDimension(),
                                             measurementMatrix.getRowDimension());
    }

    // S = H * P(k) - * H' + R
    RealMatrix s = measurementMatrix.multiply(errorCovariance)
        .multiply(measurementMatrixT)
        .add(measurementModel.getMeasurementNoise());

    // invert S
    // as the error covariance matrix is a symmetric positive
    // semi-definite matrix, we can use the cholesky decomposition
    DecompositionSolver solver = new CholeskyDecomposition(s).getSolver();
    RealMatrix invertedS = solver.getInverse();

    // Inn = z(k) - H * xHat(k)-
    RealVector innovation = z.subtract(measurementMatrix.operate(stateEstimation));

    // calculate gain matrix
    // K(k) = P(k)- * H' * (H * P(k)- * H' + R)^-1
    // K(k) = P(k)- * H' * S^-1
    RealMatrix kalmanGain = errorCovariance.multiply(measurementMatrixT).multiply(invertedS);

    // update estimate with measurement z(k)
    // xHat(k) = xHat(k)- + K * Inn
    stateEstimation = stateEstimation.add(kalmanGain.operate(innovation));

    // update covariance of prediction error
    // P(k) = (I - K * H) * P(k)-
    RealMatrix identity = MatrixUtils.createRealIdentityMatrix(kalmanGain.getRowDimension());
    errorCovariance = identity.subtract(kalmanGain.multiply(measurementMatrix)).multiply(errorCovariance);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:46,代码来源:KalmanFilter.java


示例6: invSPD

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
public Matrix invSPD() {
	try {
		return CommonsMathDenseDoubleMatrix2DFactory.INSTANCE.dense(new CholeskyDecomposition(matrix).getSolver()
				.getInverse());
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:ujmp,项目名称:universal-java-matrix-package,代码行数:9,代码来源:AbstractCommonsMathDenseDoubleMatrix2D.java


示例7: solveSPD

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
public Matrix solveSPD(Matrix b) {
	try {
		if (b instanceof AbstractCommonsMathDenseDoubleMatrix2D) {
			AbstractCommonsMathDenseDoubleMatrix2D b2 = (AbstractCommonsMathDenseDoubleMatrix2D) b;
			RealMatrix ret = new CholeskyDecomposition(matrix).getSolver().solve(b2.matrix);
			return CommonsMathDenseDoubleMatrix2DFactory.INSTANCE.dense(ret);
		} else {
			return super.solve(b);
		}
	} catch (Exception e) {
		throw new RuntimeException(e);
	}
}
 
开发者ID:ujmp,项目名称:universal-java-matrix-package,代码行数:14,代码来源:AbstractCommonsMathDenseDoubleMatrix2D.java


示例8: fit

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
public void fit(List<Location> locations){
	setLocations(locations);
	int n = locations.size();
	double[][] K = new double[n][n];

	for(int i=0; i<n; i++){
		Location loc1 = locations.get(i);
		double[] x1 = ModelAdaptUtils.locationToVec(loc1);
		for(int j=i; j<n; j++){
			Location loc2 = locations.get(j);
			double[] x2 = ModelAdaptUtils.locationToVec(loc2);
			double k =kernel.computeKernel(x1, x2);
			K[i][j] = k;
			K[j][i] = k;
		}
	}
	RealMatrix Kmat = MatrixUtils.createRealMatrix(K);
	RealMatrix lambdamat = MatrixUtils.createRealIdentityMatrix(n).scalarMultiply(sigma_n*sigma_n); //Tentative treatment

	RealMatrix Kymat = Kmat.add(lambdamat);

	CholeskyDecomposition chol = new CholeskyDecomposition(Kymat);
	RealMatrix Lmat = chol.getL();

	double[] normalRands = new double[n];
	for(int i=0; i<n; i++){
		normalRands[i] = rand.nextGaussian();
	}
	this.y = Lmat.operate(normalRands);

	RealMatrix invKymat = (new LUDecomposition(Kymat)).getSolver().getInverse();
	this.alphas = invKymat.operate(y);
}
 
开发者ID:hulop,项目名称:BLELocalization,代码行数:34,代码来源:SyntheticBeaconDataGenerator.java


示例9: computeCholesky

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Function to compute Cholesky decomposition of the given input matrix. 
 * The input must be a real symmetric positive-definite matrix.
 * 
 * @param in commons-math3 Array2DRowRealMatrix
 * @return matrix block
 * @throws DMLRuntimeException if DMLRuntimeException occurs
 */
private static MatrixBlock computeCholesky(Array2DRowRealMatrix in) 
	throws DMLRuntimeException 
{	
	if ( !in.isSquare() )
		throw new DMLRuntimeException("Input to cholesky() must be square matrix -- given: a " + in.getRowDimension() + "x" + in.getColumnDimension() + " matrix.");

	CholeskyDecomposition cholesky = new CholeskyDecomposition(in, 1e-14,
		CholeskyDecomposition.DEFAULT_ABSOLUTE_POSITIVITY_THRESHOLD);
	RealMatrix rmL = cholesky.getL();
	
	return DataConverter.convertToMatrixBlock(rmL.getData());
}
 
开发者ID:apache,项目名称:systemml,代码行数:21,代码来源:LibCommonsMath.java


示例10: correct

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Correct the current state estimate with an actual measurement.
 *
 * @param z
 *            the measurement vector
 * @throws NullArgumentException
 *             if the measurement vector is {@code null}
 * @throws DimensionMismatchException
 *             if the dimension of the measurement vector does not fit
 * @throws SingularMatrixException
 *             if the covariance matrix could not be inverted
 */
public void correct(final RealVector z)
        throws NullArgumentException, DimensionMismatchException, SingularMatrixException {

    // sanity checks
    MathUtils.checkNotNull(z);
    if (z.getDimension() != measurementMatrix.getRowDimension()) {
        throw new DimensionMismatchException(z.getDimension(),
                                             measurementMatrix.getRowDimension());
    }

    // S = H * P(k) - * H' + R
    RealMatrix s = measurementMatrix.multiply(errorCovariance)
        .multiply(measurementMatrixT)
        .add(measurementModel.getMeasurementNoise());

    // invert S
    // as the error covariance matrix is a symmetric positive
    // semi-definite matrix, we can use the cholesky decomposition
    DecompositionSolver solver = new CholeskyDecomposition(s).getSolver();
    RealMatrix invertedS = solver.getInverse();

    // Inn = z(k) - H * xHat(k)-
    RealVector innovation = z.subtract(measurementMatrix.operate(stateEstimation));

    // calculate gain matrix
    // K(k) = P(k)- * H' * (H * P(k)- * H' + R)^-1
    // K(k) = P(k)- * H' * S^-1
    RealMatrix kalmanGain = errorCovariance.multiply(measurementMatrixT).multiply(invertedS);

    // update estimate with measurement z(k)
    // xHat(k) = xHat(k)- + K * Inn
    stateEstimation = stateEstimation.add(kalmanGain.operate(innovation));

    // update covariance of prediction error
    // P(k) = (I - K * H) * P(k)-
    RealMatrix identity = MatrixUtils.createRealIdentityMatrix(kalmanGain.getRowDimension());
    errorCovariance = identity.subtract(kalmanGain.multiply(measurementMatrix)).multiply(errorCovariance);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:51,代码来源:KalmanFilter.java


示例11: CholeskyDecompositionCommonsResult

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Constructor.
 * @param ch The result of the Cholesky decomposition.
 */
public CholeskyDecompositionCommonsResult(CholeskyDecomposition ch) {
  ArgChecker.notNull(ch, "Cholesky decomposition");
  _determinant = ch.getDeterminant();
  _l = CommonsMathWrapper.unwrap(ch.getL());
  _lt = CommonsMathWrapper.unwrap(ch.getLT());
  _solver = ch.getSolver();
}
 
开发者ID:OpenGamma,项目名称:Strata,代码行数:12,代码来源:CholeskyDecompositionCommonsResult.java


示例12: ellipticalSliceSampler

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
public static SampleLikelihood ellipticalSliceSampler(IntDoubleVector initial_pt, double initial_lnpdf, CholeskyDecomposition decomp, Function lnpdf) {	
	
	int D = lnpdf.getNumDimensions();
	double [] x = new double[D];
	for(int i=0; i<D; i++) x[i] = initial_pt.get(i);
	RealMatrix init_val = MatrixUtils.createColumnRealMatrix(x);
	RealMatrix L = decomp.getL();
	RealMatrix r = MatrixUtils.createColumnRealMatrix(getNormalVector(D));
	RealMatrix nu = L.multiply(r);
	double hh = Math.log(Prng.nextDouble()) + initial_lnpdf;
	
	// Set up the ellipse and the slice threshold
	double phi = Prng.nextDouble()*2.0*Math.PI;
	double phi_min = phi-2.0*Math.PI;
	double phi_max = phi;
	
	// Slice sampling loop
	while(true) {
		// Compute xx for proposed angle difference and check if it's on the slice
		RealMatrix xx_prop = init_val.scalarMultiply(phi).add(nu.scalarMultiply(Math.sin(phi)));
		double cur_lnpdf = lnpdf.getValue(new IntDoubleDenseVector(xx_prop.getColumn(0)));
		if(cur_lnpdf > hh) {
			return new SampleLikelihood(xx_prop.getColumnVector(0).toArray(), cur_lnpdf);
		}
		// Shrink slice to rejected point
		if(phi > 0) {
			phi_max = phi;
		} else if(phi < 0) {
			phi_min = phi;
		} else {
			throw new RuntimeException("Shrunk to current position and still not acceptable");
		}
		// Propose new angle difference
		phi = Prng.nextDouble()*(phi_max - phi_min) + phi_min;
	}
}
 
开发者ID:mgormley,项目名称:optimize,代码行数:37,代码来源:Stats.java


示例13: initialize

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
private void initialize() {
    final int dim = scaleMatrix.getColumnDimension();

    // Build gamma distributions for the diagonal
    gammas = new GammaDistribution[dim];
    for (int i = 0; i < dim; i++) {

        gammas[i] = new GammaDistribution(df-i-.99/2, 2);
    }

    // Build the cholesky decomposition
    cholesky = new CholeskyDecomposition(scaleMatrix);
}
 
开发者ID:MASPlanes,项目名称:MASPlanes,代码行数:14,代码来源:InverseWishartDistribution.java


示例14: correct

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Correct the current state estimate with an actual measurement.
 *
 * @param z
 *            the measurement vector
 * @throws NullArgumentException
 *             if the measurement vector is {@code null}
 * @throws DimensionMismatchException
 *             if the dimension of the measurement vector does not fit
 * @throws SingularMatrixException
 *             if the covariance matrix could not be inverted
 */
public void correct(final RealVector z) throws NullArgumentException,
           DimensionMismatchException, SingularMatrixException
{

	// sanity checks
	MathUtils.checkNotNull(z);
	if (z.getDimension() != measurementMatrix.getRowDimension())
	{
		throw new DimensionMismatchException(z.getDimension(),
				measurementMatrix.getRowDimension());
	}

	// S = H * P(k) * H' + R
	RealMatrix s = measurementMatrix.multiply(errorCovariance)
			.multiply(measurementMatrixT)
			.add(measurementModel.getMeasurementNoise());

	// Inn = z(k) - H * xHat(k)-
	RealVector innovation = z.subtract(measurementMatrix
			.operate(stateEstimation));

	// calculate gain matrix
	// K(k) = P(k)- * H' * (H * P(k)- * H' + R)^-1
	// K(k) = P(k)- * H' * S^-1

	// instead of calculating the inverse of S we can rearrange the formula,
	// and then solve the linear equation A x X = B with A = S', X = K' and
	// B = (H * P)'

	// K(k) * S = P(k)- * H'
	// S' * K(k)' = H * P(k)-'
	RealMatrix kalmanGain = new CholeskyDecomposition(s).getSolver()
			.solve(measurementMatrix.multiply(errorCovariance.transpose()))
			.transpose();

	// update estimate with measurement z(k)
	// xHat(k) = xHat(k)- + K * Inn
	stateEstimation = stateEstimation.add(kalmanGain.operate(innovation));

	// update covariance of prediction error
	// P(k) = (I - K * H) * P(k)-
	RealMatrix identity = MatrixUtils.createRealIdentityMatrix(kalmanGain
			.getRowDimension());
	errorCovariance = identity.subtract(
			kalmanGain.multiply(measurementMatrix)).multiply(
			errorCovariance);
}
 
开发者ID:KalebKE,项目名称:FSensor,代码行数:60,代码来源:RotationKalmanFilter.java


示例15: XCD

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Constructor
 * @param matrix    the input matrix
 */
XCD(RealMatrix matrix) {
    this.cd = new CholeskyDecomposition(matrix);
    this.l = LazyValue.of(() -> toDataFrame(cd.getL()));
}
 
开发者ID:zavtech,项目名称:morpheus-core,代码行数:9,代码来源:XDataFrameAlgebraApache.java


示例16: correct

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Correct the current state estimate with an actual measurement.
 *
 * @param z
 *            the measurement vector
 * @throws NullArgumentException
 *             if the measurement vector is {@code null}
 * @throws DimensionMismatchException
 *             if the dimension of the measurement vector does not fit
 * @throws SingularMatrixException
 *             if the covariance matrix could not be inverted
 */
public void correct(final RealVector z)
        throws NullArgumentException, DimensionMismatchException, SingularMatrixException {

    // sanity checks
    MathUtils.checkNotNull(z);
    if (z.getDimension() != measurementMatrix.getRowDimension()) {
        throw new DimensionMismatchException(z.getDimension(),
                                             measurementMatrix.getRowDimension());
    }

    // S = H * P(k) * H' + R
    RealMatrix s = measurementMatrix.multiply(errorCovariance)
        .multiply(measurementMatrixT)
        .add(measurementModel.getMeasurementNoise());

    // Inn = z(k) - H * xHat(k)-
    RealVector innovation = z.subtract(measurementMatrix.operate(stateEstimation));

    // calculate gain matrix
    // K(k) = P(k)- * H' * (H * P(k)- * H' + R)^-1
    // K(k) = P(k)- * H' * S^-1

    // instead of calculating the inverse of S we can rearrange the formula,
    // and then solve the linear equation A x X = B with A = S', X = K' and B = (H * P)'

    // K(k) * S = P(k)- * H'
    // S' * K(k)' = H * P(k)-'
    RealMatrix kalmanGain = new CholeskyDecomposition(s).getSolver()
            .solve(measurementMatrix.multiply(errorCovariance.transpose()))
            .transpose();

    // update estimate with measurement z(k)
    // xHat(k) = xHat(k)- + K * Inn
    stateEstimation = stateEstimation.add(kalmanGain.operate(innovation));

    // update covariance of prediction error
    // P(k) = (I - K * H) * P(k)-
    RealMatrix identity = MatrixUtils.createRealIdentityMatrix(kalmanGain.getRowDimension());
    errorCovariance = identity.subtract(kalmanGain.multiply(measurementMatrix)).multiply(errorCovariance);
}
 
开发者ID:biocompibens,项目名称:SME,代码行数:53,代码来源:KalmanFilter.java


示例17: evolve

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
@Override
public Solution[] evolve(Solution[] parents) {
	int k = parents.length;
	int n = parents[0].getNumberOfVariables();
	RealMatrix x = new Array2DRowRealMatrix(k, n);
	
	for (int i=0; i<k; i++) {
		x.setRow(i, EncodingUtils.getReal(parents[i]));
	}
	
	try {
		//perform Cholesky factorization and get the upper triangular matrix
		double jumpRate = Math.pow(jumpRateCoefficient / Math.sqrt(n), 2.0);

		RealMatrix chol = new CholeskyDecomposition(
					new Covariance(x.scalarMultiply(jumpRate))
					.getCovarianceMatrix()).getLT();
		
		//produce the offspring
		Solution[] offspring = new Solution[numberOfOffspring];
		
		for (int i=0; i<numberOfOffspring; i++) {
			Solution child = parents[PRNG.nextInt(parents.length)].copy();
			
			//apply adaptive metropolis step to solution
			RealVector muC = new ArrayRealVector(
					EncodingUtils.getReal(child));
			RealVector ru = new ArrayRealVector(n);
			
			for (int j=0; j<n; j++) {
				ru.setEntry(j, PRNG.nextGaussian());
			}
			
			double[] variables = muC.add(chol.preMultiply(ru)).toArray();
			
			//assign variables back to solution
			for (int j=0; j<n; j++) {
				RealVariable variable = (RealVariable)child.getVariable(j);
				double value = variables[j];

				if (value < variable.getLowerBound()) {
					value = variable.getLowerBound();
				} else if (value > variable.getUpperBound()) {
					value = variable.getUpperBound();
				}

				variable.setValue(value);
			}
			
			offspring[i] = child;
		}
		
		return offspring;
	} catch (Exception e) {
		return new Solution[0];
	}
}
 
开发者ID:Matsemann,项目名称:eamaster,代码行数:58,代码来源:AdaptiveMetropolis.java


示例18: calcCholeskyDecomposition

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * Calculate Cholesky decomposition A = L L^T
 * @param a
 * @return L
 */
public static Dataset calcCholeskyDecomposition(Dataset a) {
	CholeskyDecomposition cd = new CholeskyDecomposition(createRealMatrix(a));
	return createDataset(cd.getL());
}
 
开发者ID:eclipse,项目名称:january,代码行数:10,代码来源:LinearAlgebra.java


示例19: choleskyFromMatrix

import org.apache.commons.math3.linear.CholeskyDecomposition; //导入依赖的package包/类
/**
 * This will return the cholesky decomposition of
 * the given matrix
 * @param m the matrix to convert
 * @return the cholesky decomposition of the given
 * matrix.
 * See:
 * http://en.wikipedia.org/wiki/Cholesky_decomposition
 * @throws NonSquareMatrixException
 */
public CholeskyDecomposition choleskyFromMatrix(RealMatrix m) throws Exception {
    return new CholeskyDecomposition(m);
}
 
开发者ID:deeplearning4j,项目名称:deeplearning4j,代码行数:14,代码来源:MathUtils.java



注:本文中的org.apache.commons.math3.linear.CholeskyDecomposition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ID3v2类代码示例发布时间:2022-05-21
下一篇:
Java IntProperty类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap