Search in sources :

Example 6 with CholeskyDecomposition

use of dr.math.matrixAlgebra.CholeskyDecomposition in project beast-mcmc by beast-dev.

the class CorrelationToCholesky method transform.

// values = correlation
@Override
protected double[] transform(double[] values) {
    SymmetricMatrix R = compoundCorrelationSymmetricMatrix(values, dimVector);
    double[] L;
    try {
        L = (new CholeskyDecomposition(R)).getStrictlyUpperTriangular();
    } catch (IllegalDimension illegalDimension) {
        throw new RuntimeException("Unable to decompose matrix in LKJ inverse transform.");
    }
    return L;
}
Also used : CholeskyDecomposition(dr.math.matrixAlgebra.CholeskyDecomposition) IllegalDimension(dr.math.matrixAlgebra.IllegalDimension) SymmetricMatrix.compoundCorrelationSymmetricMatrix(dr.math.matrixAlgebra.SymmetricMatrix.compoundCorrelationSymmetricMatrix) SymmetricMatrix(dr.math.matrixAlgebra.SymmetricMatrix)

Aggregations

CholeskyDecomposition (dr.math.matrixAlgebra.CholeskyDecomposition)6 IllegalDimension (dr.math.matrixAlgebra.IllegalDimension)6 SymmetricMatrix (dr.math.matrixAlgebra.SymmetricMatrix)3 SymmetricMatrix.compoundCorrelationSymmetricMatrix (dr.math.matrixAlgebra.SymmetricMatrix.compoundCorrelationSymmetricMatrix)2 NodeRef (dr.evolution.tree.NodeRef)1