@Test public void testJointP() { System.out.println("joint p"); int[] o = {0, 0, 1, 1, 0, 1, 1, 0}; int[] s = {0, 0, 1, 1, 1, 1, 1, 0}; HMM hmm = new HMM(pi, new Matrix(a), new Matrix(b)); double expResult = 7.33836e-05; double result = hmm.p(o, s); assertEquals(expResult, result, 1E-10); }
public double p(int[] o, int[] s) { return Math.exp(logp(o, s)); }
HMM implements Serializable { public double p(int[] o, int[] s) { return Math.exp(logp(o, s)); } }
HMM implements Serializable { public double p(int[] o, int[] s) { return Math.exp(logp(o, s)); } HMM(double[] pi, Matrix a, Matrix b); }
HMM implements Serializable { public double p(int[] o, int[] s) { return Math.exp(logp(o, s)); } HMM(double[] pi, Matrix a, Matrix b); double[] getInitialStateProbabilities(); Matrix getStateTransitionProbabilities(); Matrix getSymbolEmissionProbabilities(); double p(int[] o, int[] s); double logp(int[] o, int[] s); double p(int[] o); double logp(int[] o); int[] predict(int[] o); static HMM fit(int[][] observations, int[][] labels); static HMM fit(T[][] observations, int[][] labels, ToIntFunction<T> ordinal); void update(T[][] observations, int iterations, ToIntFunction<T> ordinal); void update(int[][] observations, int iterations); @Override String toString(); }
HMM implements Serializable { public double p(int[] o, int[] s) { return Math.exp(logp(o, s)); } HMM(double[] pi, Matrix a, Matrix b); double[] getInitialStateProbabilities(); Matrix getStateTransitionProbabilities(); Matrix getSymbolEmissionProbabilities(); double p(int[] o, int[] s); double logp(int[] o, int[] s); double p(int[] o); double logp(int[] o); int[] predict(int[] o); static HMM fit(int[][] observations, int[][] labels); static HMM fit(T[][] observations, int[][] labels, ToIntFunction<T> ordinal); void update(T[][] observations, int iterations, ToIntFunction<T> ordinal); void update(int[][] observations, int iterations); @Override String toString();  }