Package org.encog.ml.hmm.distributions

Examples of org.encog.ml.hmm.distributions.DiscreteDistribution


      new HiddenMarkovModel(2, 2);
   
    hmm.setPi(0, 0.95);
    hmm.setPi(1, 0.05);
   
    hmm.setStateDistribution(0, new DiscreteDistribution(new double[][] { { 0.95, 0.05 } }));
    hmm.setStateDistribution(1, new DiscreteDistribution(new double[][] { { 0.20, 0.80 } }));
   
    hmm.setTransitionProbability(0, 1, 0.05);
    hmm.setTransitionProbability(0, 0, 0.95);
    hmm.setTransitionProbability(1, 0, 0.10);
    hmm.setTransitionProbability(1, 1, 0.90);
View Full Code Here


      new HiddenMarkovModel(2, 2);
   
    hmm.setPi(0, 0.95);
    hmm.setPi(1, 0.05);
   
    hmm.setStateDistribution(0, new DiscreteDistribution(new double[][] { { 0.95, 0.05 } }));
    hmm.setStateDistribution(1, new DiscreteDistribution(new double[][] { { 0.20, 0.80 } }));
   
    hmm.setTransitionProbability(0, 1, 0.05);
    hmm.setTransitionProbability(0, 0, 0.95);
    hmm.setTransitionProbability(1, 0, 0.10);
    hmm.setTransitionProbability(1, 1, 0.90);
View Full Code Here

    HiddenMarkovModel hmm = new HiddenMarkovModel(2,2);
   
    hmm.setPi(0, 0.50);
    hmm.setPi(1, 0.50);
   
    hmm.setStateDistribution(0, new DiscreteDistribution(new double[][] { { 0.8, 0.2 } }));
    hmm.setStateDistribution(1, new DiscreteDistribution(new double[][] { { 0.1, 0.9 } }));
   
    hmm.setTransitionProbability(0, 1, 0.2);
    hmm.setTransitionProbability(0, 0, 0.8);
    hmm.setTransitionProbability(1, 0, 0.2);
    hmm.setTransitionProbability(1, 1, 0.8);
View Full Code Here

    this.transitionProbability = new double[theStates][theStates];
    this.stateDistributions = new StateDistribution[theStates];

    for (int i = 0; i < theStates; i++) {
      this.pi[i] = 1. / theStates;
      this.stateDistributions[i] = new DiscreteDistribution(this.items);

      for (int j = 0; j < theStates; j++) {
        this.transitionProbability[i][j] = 1.0 / theStates;
      }
    }
View Full Code Here

  public StateDistribution createNewDistribution() {
    if (isContinuous()) {
      return new ContinousDistribution(getStateCount());
    } else {
      return new DiscreteDistribution(this.items);
    }
  }
View Full Code Here

          Matrix cova = section.parseMatrix(params, HiddenMarkovModel.TAG_COVARIANCE);
          ContinousDistribution dist = new ContinousDistribution(mean,cova.getData());
          distributions.add(dist);
        } else if( "DiscreteDistribution".equals(t) ) {
          Matrix prob = section.parseMatrix(params, HiddenMarkovModel.TAG_PROBABILITIES);
          DiscreteDistribution dist = new DiscreteDistribution(prob.getData());
          distributions.add(dist);
        }
      }
    }
   
View Full Code Here

        ContinousDistribution cDist = (ContinousDistribution)sd;
        out.writeProperty(HiddenMarkovModel.TAG_MEAN, cDist.getMean());
        out.writeProperty(HiddenMarkovModel.TAG_COVARIANCE, cDist.getCovariance());
       
      } else if( sd instanceof DiscreteDistribution ) {
        DiscreteDistribution dDist = (DiscreteDistribution)sd;
        out.writeProperty(HiddenMarkovModel.TAG_PROBABILITIES, new Matrix(dDist.getProbabilities()));
      }
    }

    out.flush();
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.hmm.distributions.DiscreteDistribution

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.