Search in sources :

Example 1 with FactorTreeGibbsOperator

use of dr.inference.operators.factorAnalysis.FactorTreeGibbsOperator in project beast-mcmc by beast-dev.

the class FactorTreeGibbsOperatorParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    String weightTemp = (String) xo.getAttribute(WEIGHT);
    double weight = Double.parseDouble(weightTemp);
    LatentFactorModel lfm = (LatentFactorModel) xo.getChild(LatentFactorModel.class);
    GibbsSampleFromTreeInterface tree = (GibbsSampleFromTreeInterface) xo.getChild(GibbsSampleFromTreeInterface.class);
    GibbsSampleFromTreeInterface workingTree = null;
    if (xo.getChild(WORKING_PRIOR) != null) {
        workingTree = (GibbsSampleFromTreeInterface) xo.getChild(WORKING_PRIOR).getChild(GibbsSampleFromTreeInterface.class);
    }
    boolean randomScan = xo.getAttribute(RANDOM_SCAN, true);
    FactorTreeGibbsOperator lfmOp = new FactorTreeGibbsOperator(weight, lfm, tree, randomScan);
    if (xo.hasAttribute(PATH_PARAMETER)) {
        System.out.println("WARNING: Setting Path Parameter is intended for debugging purposes only!");
        lfmOp.setPathParameter(xo.getDoubleAttribute(PATH_PARAMETER));
    }
    return lfmOp;
}
Also used : FactorTreeGibbsOperator(dr.inference.operators.factorAnalysis.FactorTreeGibbsOperator) LatentFactorModel(dr.inference.model.LatentFactorModel) GibbsSampleFromTreeInterface(dr.evomodel.continuous.GibbsSampleFromTreeInterface)

Aggregations

GibbsSampleFromTreeInterface (dr.evomodel.continuous.GibbsSampleFromTreeInterface)1 LatentFactorModel (dr.inference.model.LatentFactorModel)1 FactorTreeGibbsOperator (dr.inference.operators.factorAnalysis.FactorTreeGibbsOperator)1