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;
}
Aggregations