Search in sources :

Example 16 with LatentFactorModel

use of dr.inference.model.LatentFactorModel in project beast-mcmc by beast-dev.

the class LatentFactorModelPrecisionGibbsOperatorParser 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);
    DistributionLikelihood prior = (DistributionLikelihood) xo.getChild(DistributionLikelihood.class);
    boolean randomScan = xo.getAttribute(RANDOM_SCAN, true);
    LatentFactorModelPrecisionGibbsOperator lfmOp = new LatentFactorModelPrecisionGibbsOperator(LFM, prior, weight, 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 : LatentFactorModel(dr.inference.model.LatentFactorModel) LatentFactorModelPrecisionGibbsOperator(dr.inference.operators.factorAnalysis.LatentFactorModelPrecisionGibbsOperator) DistributionLikelihood(dr.inference.distribution.DistributionLikelihood)

Example 17 with LatentFactorModel

use of dr.inference.model.LatentFactorModel in project beast-mcmc by beast-dev.

the class LoadingsIndependenceOperatorParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    AdaptationMode mode = AdaptationMode.parseMode(xo);
    String scaleFactorTemp = (String) xo.getAttribute(SCALE_FACTOR);
    double scaleFactor = Double.parseDouble(scaleFactorTemp);
    String weightTemp = (String) xo.getAttribute(WEIGHT);
    double weight = Double.parseDouble(weightTemp);
    LatentFactorModel LFM = (LatentFactorModel) xo.getChild(LatentFactorModel.class);
    DistributionLikelihood prior = (DistributionLikelihood) xo.getChild(DistributionLikelihood.class);
    boolean randomScan = xo.getAttribute(RANDOM_SCAN, true);
    // To change body of implemented methods use File | Settings | File Templates.
    return new LoadingsIndependenceOperator(LFM, prior, weight, randomScan, scaleFactor, mode);
}
Also used : AdaptationMode(dr.inference.operators.AdaptationMode) LoadingsIndependenceOperator(dr.inference.operators.factorAnalysis.LoadingsIndependenceOperator) LatentFactorModel(dr.inference.model.LatentFactorModel) DistributionLikelihood(dr.inference.distribution.DistributionLikelihood)

Aggregations

LatentFactorModel (dr.inference.model.LatentFactorModel)17 DistributionLikelihood (dr.inference.distribution.DistributionLikelihood)6 DiagonalMatrix (dr.inference.model.DiagonalMatrix)6 AdaptationMode (dr.inference.operators.AdaptationMode)5 MomentDistributionModel (dr.inference.distribution.MomentDistributionModel)3 CoercionMode (dr.inference.operators.CoercionMode)3 OrderedLatentLiabilityLikelihood (dr.evomodel.continuous.OrderedLatentLiabilityLikelihood)2 MatrixParameterInterface (dr.inference.model.MatrixParameterInterface)2 FullyConjugateMultivariateTraitLikelihood (dr.evomodel.continuous.FullyConjugateMultivariateTraitLikelihood)1 GibbsSampleFromTreeInterface (dr.evomodel.continuous.GibbsSampleFromTreeInterface)1 TreeDataLikelihood (dr.evomodel.treedatalikelihood.TreeDataLikelihood)1 IntegratedFactorAnalysisLikelihood (dr.evomodel.treedatalikelihood.continuous.IntegratedFactorAnalysisLikelihood)1 MatrixParameter (dr.inference.model.MatrixParameter)1 FactorGibbsOperator (dr.inference.operators.FactorGibbsOperator)1 FactorIndependenceOperator (dr.inference.operators.FactorIndependenceOperator)1 FactorOperator (dr.inference.operators.FactorOperator)1 LatentFactorLiabilityGibbsOperator (dr.inference.operators.LatentFactorLiabilityGibbsOperator)1 LatentFactorModelPrecisionGibbsOperator (dr.inference.operators.LatentFactorModelPrecisionGibbsOperator)1 LoadingsGibbsOperator (dr.inference.operators.LoadingsGibbsOperator)1 LoadingsGibbsTruncatedOperator (dr.inference.operators.LoadingsGibbsTruncatedOperator)1