Package stallone.api.hmm

Examples of stallone.api.hmm.IHMMParameters


            throws ParameterEstimationException
    {
        System.out.println("HMM initialized with timescales: "+msm.timescales(TCInit, tau));
       
        // initial parameters
        IHMMParameters par0 = hmmNew.parameters(nhidden, true, true);
        par0.setTransitionMatrix(TCInit.copy());
        for (int i = 0; i < nhidden; i++)
        {
            par0.setOutputParameters(i, ChiInit.viewColumn(i));
        }

        // Estimate
        int nObservableStates = ChiInit.rows();
        double[] uniformPrior = new double[nObservableStates];
        java.util.Arrays.fill(uniformPrior, 1.0 / (double) uniformPrior.length);
        IExpectationMaximization EM = hmmNew.emDiscrete(observations, par0, uniformPrior);
        EM.setMaximumNumberOfStep(nIterHMMMax);
        EM.setLikelihoodDecreaseTolerance(maxHMMLInc);

        System.out.println(" running hmm on " + observations.size() + " x " + observations.get(0).size() + " observations with maxIter " + nIterHMMMax);
        EM.run();
        hmmLikelihoodHistory = EM.getLogLikelihoodHistory();
        System.out.println(" hmm iterations: " + hmmLikelihoodHistory.length);
        System.out.println(" likelihood history: " + doubleArrays.toString(hmmLikelihoodHistory, "\n"));

        // HMM
        this.hmmEst = EM.getHMM();
        IHMMParameters parEst = hmmEst.getParameters();

        return parEst;
    }
View Full Code Here


        //List<IDataSequence> dtrajCompressed = compressTrajectory(dtraj);
        List<IIntArray> dTrajectories = subsamples(dtraj, timeshift);
        int nstates = intseq.max(dTrajectories) + 1;
        List<IDataSequence> dtrajCompressed = toObservation(dTrajectories, nstates);

        IHMMParameters hmmParameters = hmm(dtrajCompressed, initTC, initChi);
        hmmTC = hmmParameters.getTransitionMatrix();
        hmmpiC = msm.stationaryDistribution(hmmTC);
        hmmChi = getChi(hmmParameters);

        // estimate and output timescales
        hmmTimescales = msm.timescales(hmmTC, tau);
View Full Code Here

TOP

Related Classes of stallone.api.hmm.IHMMParameters

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.